summaryrefslogblamecommitdiffstats
path: root/private/ole32/oleui/locppg.cpp
blob: f4ed404613eeae53f2ebada288d5105ab13908a4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706

































































































































































































































































































































































































































































































































































































































































































































                                                                                          
//+---------------------------------------------------------------------
//
//  Microsoft Windows
//  Copyright (C) Microsoft Corporation, 1993 - 1994.
//
//  File:       locppg.cpp
//
//  Contents:   Implements the classes CGeneralPropertyPage,
//              CLocationPropertyPage, CSecurityPropertyPage and
//              CIdentityPropertyPage which manage the four property
//              pages per AppId.
//
//  Classes:
//
//  Methods:    CGeneralPropertyPage::CGeneralPropertyPage
//              CGeneralPropertyPage::~CGeneralPropertyPage
//              CGeneralPropertyPage::DoDataExchange
//              CLocationPropertyPage::CLocationPropertyPage
//              CLocationPropertyPage::~CLocationPropertyPage
//              CLocationPropertyPage::DoDataExchange
//              CLocationPropertyPage::OnBrowse
//              CLocationPropertyPage::OnRunRemote
//              CLocationPropertyPage::UpdateControls
//              CLocationPropertyPage::OnSetActive
//              CLocationPropertyPage::OnChange
//              CSecurityPropertyPage::CSecurityPropertyPage
//              CSecurityPropertyPage::~CSecurityPropertyPage
//              CSecurityPropertyPage::DoDataExchange
//              CSecurityPropertyPage::OnDefaultAccess
//              CSecurityPropertyPage::OnCustomAccess
//              CSecurityPropertyPage::OnDefaultLaunch
//              CSecurityPropertyPage::OnCustomLaunch
//              CSecurityPropertyPage::OnDefaultConfig
//              CSecurityPropertyPage::OnCustomConfig
//              CSecurityPropertyPage::OnEditAccess
//              CSecurityPropertyPage::OnEditLaunch
//              CSecurityPropertyPage::OnEditConfig
//              CIdentityPropertyPage::CIdentityPropertyPage
//              CIdentityPropertyPage::~CIdentityPropertyPage
//              CIdentityPropertyPage::DoDataExchange
//              CIdentityPropertyPage::OnBrowse
//              CIdentityPropertyPage::OnChange
//
//  History:    23-Apr-96   BruceMa    Created.
//
//----------------------------------------------------------------------


#include "stdafx.h"
#include "afxtempl.h"
#include "assert.h"
#include "resource.h"
#include "LocPPg.h"
#include "clspsht.h"
#include "datapkt.h"
extern "C"
{
#include <getuser.h>
}
#include "util.h"
#include "virtreg.h"
#include "ntlsa.h"




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

IMPLEMENT_DYNCREATE(CGeneralPropertyPage, CPropertyPage)
IMPLEMENT_DYNCREATE(CLocationPropertyPage, CPropertyPage)
IMPLEMENT_DYNCREATE(CSecurityPropertyPage, CPropertyPage)
IMPLEMENT_DYNCREATE(CIdentityPropertyPage, CPropertyPage)


/////////////////////////////////////////////////////////////////////////////
// CGeneralPropertyPage property page

CGeneralPropertyPage::CGeneralPropertyPage() : CPropertyPage(CGeneralPropertyPage::IDD)
{
        //{{AFX_DATA_INIT(CGeneralPropertyPage)
        m_szServerName = _T("");
        m_szServerPath = _T("");
        m_szServerType = _T("");
        m_szPathTitle = _T("");
        m_szComputerName = _T("");
        //}}AFX_DATA_INIT
}

CGeneralPropertyPage::~CGeneralPropertyPage()
{
}

void CGeneralPropertyPage::DoDataExchange(CDataExchange* pDX)
{
        CPropertyPage::DoDataExchange(pDX);

        switch (m_iServerType)
        {
        case INPROC:
        case LOCALEXE:
                m_szPathTitle.LoadString(IDS_PATH);
                GetDlgItem(IDC_PATHTITLE)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINETITLE)->ShowWindow(SW_HIDE);
                GetDlgItem(IDC_SERVERPATH)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINE)->ShowWindow(SW_HIDE);
                break;
        case SERVICE:
                m_szPathTitle.LoadString(IDS_SERVICENAME);
                GetDlgItem(IDC_PATHTITLE)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINETITLE)->ShowWindow(SW_HIDE);
                GetDlgItem(IDC_SERVERPATH)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINE)->ShowWindow(SW_HIDE);
                break;
        case PURE_REMOTE:
                GetDlgItem(IDC_PATHTITLE)->ShowWindow(SW_HIDE);
                GetDlgItem(IDC_MACHINETITLE)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_SERVERPATH)->ShowWindow(SW_HIDE);
                GetDlgItem(IDC_MACHINE)->ShowWindow(SW_SHOW);
                break;
        case REMOTE_LOCALEXE:
                m_szPathTitle.LoadString(IDS_PATH);
                GetDlgItem(IDC_PATHTITLE)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINETITLE)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_SERVERPATH)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINE)->ShowWindow(SW_SHOW);
                break;
        case REMOTE_SERVICE:
                m_szPathTitle.LoadString(IDS_SERVICENAME);
                GetDlgItem(IDC_PATHTITLE)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINETITLE)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_SERVERPATH)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINE)->ShowWindow(SW_SHOW);
                break;
        case SURROGATE:
                m_szPathTitle.LoadString(IDS_PATH);
                GetDlgItem(IDC_PATHTITLE)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINETITLE)->ShowWindow(SW_HIDE);
                GetDlgItem(IDC_SERVERPATH)->ShowWindow(SW_SHOW);
                GetDlgItem(IDC_MACHINE)->ShowWindow(SW_HIDE);
                break;
        }
        m_szServerType.LoadString(IDS_SERVERTYPE0+m_iServerType);

        //{{AFX_DATA_MAP(CGeneralPropertyPage)
        DDX_Text(pDX, IDC_SERVERNAME, m_szServerName);
        DDX_Text(pDX, IDC_SERVERPATH, m_szServerPath);
        DDX_Text(pDX, IDC_SERVERTYPE, m_szServerType);
        DDX_Text(pDX, IDC_PATHTITLE, m_szPathTitle);
        DDX_Text(pDX, IDC_MACHINE, m_szComputerName);
        //}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CGeneralPropertyPage, CPropertyPage)
        //{{AFX_MSG_MAP(CGeneralPropertyPage)
                // NOTE: the ClassWizard will add message map macros here
        ON_WM_HELPINFO()
        //}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CLocationPropertyPage property page

CLocationPropertyPage::CLocationPropertyPage() : CPropertyPage(CLocationPropertyPage::IDD)
{
        //{{AFX_DATA_INIT(CLocationPropertyPage)
        m_szComputerName = _T("");
        m_fAtStorage = FALSE;
        m_fLocal = FALSE;
        m_fRemote = FALSE;
        m_iInitial = 2;
        //}}AFX_DATA_INIT
}

CLocationPropertyPage::~CLocationPropertyPage()
{
}

void CLocationPropertyPage::DoDataExchange(CDataExchange* pDX)
{
    CPropertyPage::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CLocationPropertyPage)
    DDX_Text(pDX, IDC_EDIT1, m_szComputerName);
    DDV_MaxChars(pDX, m_szComputerName, 256);
    DDX_Check(pDX, IDC_CHECK1, m_fAtStorage);
    DDX_Check(pDX, IDC_CHECK2, m_fLocal);
    DDX_Check(pDX, IDC_CHECK3, m_fRemote);
    //}}AFX_DATA_MAP
    if (m_fRemote)
    {
        pDX->PrepareEditCtrl(IDC_EDIT1);
        if (m_szComputerName.GetLength() == 0  &&  m_iInitial == 0)
        {
            CString szTemp;
            szTemp.LoadString(IDS_INVALIDSERVER);
            MessageBox(szTemp);
            pDX->Fail();
        }
    }

    if (m_fAtStorage)
    {
        m_pPage1->m_szComputerName.LoadString(IDS_ATSTORAGE);
    }
    else
        m_pPage1->m_szComputerName = m_szComputerName;

    switch(m_pPage1->m_iServerType)
    {
    case LOCALEXE:
    case SERVICE:
        if (m_fAtStorage || m_fRemote)
            m_pPage1->m_iServerType += 3;
        break;
    case REMOTE_LOCALEXE:
    case REMOTE_SERVICE:
        if (!(m_fAtStorage || m_fRemote))
            m_pPage1->m_iServerType -= 3;
        break;
    }

    if (m_iInitial)
    {
        m_iInitial--;
    }
}

BEGIN_MESSAGE_MAP(CLocationPropertyPage, CPropertyPage)
        //{{AFX_MSG_MAP(CLocationPropertyPage)
        ON_BN_CLICKED(IDC_BUTTON1, OnBrowse)
        ON_BN_CLICKED(IDC_CHECK3, OnRunRemote)
        ON_EN_CHANGE(IDC_EDIT1, OnChange)
        ON_BN_CLICKED(IDC_CHECK1, OnChange)
        ON_BN_CLICKED(IDC_CHECK2, OnChange)
        ON_WM_HELPINFO()
        //}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CLocationPropertyPage::OnBrowse()
{
    TCHAR szMachine[MAX_PATH];

    if (g_util.InvokeMachineBrowser(szMachine))
    {
        // Strip off "\\"
        GetDlgItem(IDC_EDIT1)->SetWindowText(&szMachine[2]);
        SetModified(TRUE);
    }
}

void CLocationPropertyPage::OnRunRemote()
{
    SetModified(TRUE);
    UpdateControls();
}

void CLocationPropertyPage::UpdateControls()
{
    BOOL fChecked = IsDlgButtonChecked(IDC_CHECK3);
    GetDlgItem(IDC_EDIT1)->EnableWindow(fChecked);

// Leave this browse button disabled until after SUR Beta 2
    GetDlgItem(IDC_BUTTON1)->EnableWindow(fChecked);
}

BOOL CLocationPropertyPage::OnSetActive()
{
    if (!m_fCanBeLocal)
        GetDlgItem(IDC_CHECK2)->EnableWindow(FALSE);
    UpdateControls();
    return CPropertyPage::OnSetActive();
}

void CLocationPropertyPage::OnChange()
{
    SetModified(TRUE);
}


/////////////////////////////////////////////////////////////////////////////
// CSecurityPropertyPage property page

CSecurityPropertyPage::CSecurityPropertyPage() : CPropertyPage(CSecurityPropertyPage::IDD)
{
        //{{AFX_DATA_INIT(CSecurityPropertyPage)
        m_iAccess             = -1;
        m_iLaunch             = -1;
        m_iConfig             = -1;
        m_iAccessIndex        = -1;
        m_iLaunchIndex        = -1;
        m_iConfigurationIndex = -1;
        //}}AFX_DATA_INIT
}

CSecurityPropertyPage::~CSecurityPropertyPage()
{
}

void CSecurityPropertyPage::DoDataExchange(CDataExchange* pDX)
{
        CPropertyPage::DoDataExchange(pDX);
        //{{AFX_DATA_MAP(CSecurityPropertyPage)
        DDX_Radio(pDX, IDC_RADIO1, m_iAccess);
        DDX_Radio(pDX, IDC_RADIO3, m_iLaunch);
        DDX_Radio(pDX, IDC_RADIO5, m_iConfig);
        //}}AFX_DATA_MAP
    GetDlgItem(IDC_BUTTON1)->EnableWindow(1 == m_iAccess);
        GetDlgItem(IDC_BUTTON2)->EnableWindow(1 == m_iLaunch);
        GetDlgItem(IDC_BUTTON3)->EnableWindow(1 == m_iConfig);
}

BEGIN_MESSAGE_MAP(CSecurityPropertyPage, CPropertyPage)
        //{{AFX_MSG_MAP(CSecurityPropertyPage)
        ON_BN_CLICKED(IDC_RADIO1, OnDefaultAccess)
        ON_BN_CLICKED(IDC_RADIO2, OnCustomAccess)
        ON_BN_CLICKED(IDC_RADIO3, OnDefaultLaunch)
        ON_BN_CLICKED(IDC_RADIO4, OnCustomLaunch)
        ON_BN_CLICKED(IDC_RADIO5, OnDefaultConfig)
        ON_BN_CLICKED(IDC_RADIO6, OnCustomConfig)
        ON_BN_CLICKED(IDC_BUTTON1, OnEditAccess)
        ON_BN_CLICKED(IDC_BUTTON2, OnEditLaunch)
        ON_BN_CLICKED(IDC_BUTTON3, OnEditConfig)
        ON_WM_HELPINFO()
        //}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CSecurityPropertyPage::OnDefaultAccess()
{
    // Disable the edit access permissions window
    UpdateData(TRUE);

    // If there is an SD here then mark it for delete
    if (m_iAccessIndex != -1)
    {
        CDataPacket &cdp = g_virtreg.GetAt(m_iAccessIndex);
        cdp.fDelete = TRUE;
        SetModified(TRUE);
    }
}

void CSecurityPropertyPage::OnCustomAccess()
{
    UpdateData(TRUE);

    // If there is an SD here then unmark it for delete
    if (m_iAccessIndex != -1)
    {
        CDataPacket &cdp = g_virtreg.GetAt(m_iAccessIndex);
        cdp.fDelete = FALSE;
        SetModified(TRUE);
    }
}

void CSecurityPropertyPage::OnDefaultLaunch()
{
    UpdateData(TRUE);

    // If there is an SD here then mark it for delete
    if (m_iLaunchIndex != -1)
    {
        CDataPacket &cdp = g_virtreg.GetAt(m_iLaunchIndex);
        cdp.fDelete = TRUE;
        SetModified(TRUE);
    }
}

void CSecurityPropertyPage::OnCustomLaunch()
{
    UpdateData(TRUE);

    // If there is an SD here then unmark it for delete
    if (m_iLaunchIndex != -1)
    {
        CDataPacket &cdp = g_virtreg.GetAt(m_iLaunchIndex);
        cdp.fDelete = FALSE;
    }
}

void CSecurityPropertyPage::OnDefaultConfig()
{
    int   err;
    ULONG ulSize = 1;
    BYTE *pbValue = NULL;

    // Read the security descriptor for HKEY_CLASSES_ROOT
    // Note: We always expect to get ERROR_INSUFFICIENT_BUFFER
    err = RegGetKeySecurity(HKEY_CLASSES_ROOT,
                            OWNER_SECURITY_INFORMATION |
                            GROUP_SECURITY_INFORMATION |
                            DACL_SECURITY_INFORMATION,
                            pbValue,
                            &ulSize);
    if (err == ERROR_INSUFFICIENT_BUFFER)
    {
        pbValue = new BYTE[ulSize];
        if (pbValue == NULL)
        {
            return;
        }
        err = RegGetKeySecurity(HKEY_CLASSES_ROOT,
                                OWNER_SECURITY_INFORMATION |
                                GROUP_SECURITY_INFORMATION |
                                DACL_SECURITY_INFORMATION,
                                pbValue,
                                &ulSize);
    }
    // Change the custom security back to the default, if there is a custom
    // security descriptor, but just in the virtual registry -
    // in case the user cancels
    if (m_iConfigurationIndex != -1)
    {
        CDataPacket &cdb = g_virtreg.GetAt(m_iConfigurationIndex);
        cdb.ChgACL((SECURITY_DESCRIPTOR *) pbValue, TRUE);
        cdb.fDirty = TRUE;
    }
    delete pbValue;

    UpdateData(TRUE);
    SetModified(TRUE);
}



void CSecurityPropertyPage::OnCustomConfig()
{
    // If a security descriptor already exists, then the user was here
    // before, then selected default configuration.  So just copy the
    // original as the extant custom configuration
    if (m_iConfigurationIndex != -1)
    {
        CDataPacket &cdb = g_virtreg.GetAt(m_iConfigurationIndex);
        cdb.ChgACL(cdb.pkt.racl.pSecOrig, TRUE);
    }

    UpdateData(TRUE);
    SetModified(TRUE);
}



void CSecurityPropertyPage::OnEditAccess()
{
    int     err;
    CString szAccess;

    szAccess.LoadString(IDS_Access);

    // Invoke the ACL editor
    err = g_util.ACLEditor(m_hWnd,
                           g_hAppid,
                           NULL,
                           TEXT("AccessPermission"),
                           &m_iAccessIndex,
                           SingleACL,
                           (TCHAR *) ((LPCTSTR) szAccess));

    // Enable the Apply button
    if (err == ERROR_SUCCESS)
    {
        SetModified(TRUE);
    }
}

void CSecurityPropertyPage::OnEditLaunch()
{
    int     err;
    CString szLaunch;

    szLaunch.LoadString(IDS_Launch);

    // Invoke the ACL editor
    err = g_util.ACLEditor(m_hWnd,
                           g_hAppid,
                           NULL,
                           TEXT("LaunchPermission"),
                           &m_iLaunchIndex,
                           SingleACL,
                           (TCHAR *) ((LPCTSTR) szLaunch));

    // Enable the Apply button
    if (err == ERROR_SUCCESS)
    {
        SetModified(TRUE);
    }
}

void CSecurityPropertyPage::OnEditConfig()
{
    int     err = ERROR_SUCCESS;

    // Invoke the ACL editor
    err = g_util.ACLEditor2(m_hWnd,
                            g_hAppid,
                            g_rghkCLSID,
                            g_cCLSIDs,
                            g_szAppTitle,
                            &m_iConfigurationIndex,
                            RegKeyACL);

    // Enable the Apply button
    if (err == ERROR_SUCCESS)
    {
        SetModified(TRUE);
    }
    else if (err == ERROR_ACCESS_DENIED)
    {
        g_util.CkForAccessDenied(ERROR_ACCESS_DENIED);
    }
    else if (err != IDCANCEL)
    {
        g_util.PostErrorMessage();
    }
}


/////////////////////////////////////////////////////////////////////////////
// CIdentityPropertyPage property page

CIdentityPropertyPage::CIdentityPropertyPage() : CPropertyPage(CIdentityPropertyPage::IDD)
{
        //{{AFX_DATA_INIT(CIdentityPropertyPage)
        m_szUserName = _T("");
        m_szPassword = _T("");
        m_szConfirmPassword = _T("");
        m_iIdentity = -1;
        //}}AFX_DATA_INIT
}

CIdentityPropertyPage::~CIdentityPropertyPage()
{
}

void CIdentityPropertyPage::DoDataExchange(CDataExchange* pDX)
{
    // If server is not a service, disable IDC_RADIO4 on page4.
    if (m_fService)
    {
        GetDlgItem(IDC_RADIO1)->EnableWindow(FALSE);
        GetDlgItem(IDC_RADIO2)->EnableWindow(FALSE);
    }
    else
    {
        GetDlgItem(IDC_RADIO4)->EnableWindow(FALSE);
    }

    CPropertyPage::DoDataExchange(pDX);

    //{{AFX_DATA_MAP(CIdentityPropertyPage)
    DDX_Text(pDX, IDC_EDIT1, m_szUserName);
    DDV_MaxChars(pDX, m_szUserName, 128);
    DDX_Text(pDX, IDC_EDIT2, m_szPassword);
    DDV_MaxChars(pDX, m_szPassword, 128);
    DDX_Text(pDX, IDC_EDIT3, m_szConfirmPassword);
    DDV_MaxChars(pDX, m_szConfirmPassword, 128);
    DDX_Radio(pDX, IDC_RADIO1, m_iIdentity);
    //}}AFX_DATA_MAP

    GetDlgItem(IDC_EDIT1)->EnableWindow(2 == m_iIdentity);
    GetDlgItem(IDC_STATIC1)->EnableWindow(2 == m_iIdentity);
    GetDlgItem(IDC_EDIT2)->EnableWindow(2 == m_iIdentity);
    GetDlgItem(IDC_STATIC2)->EnableWindow(2 == m_iIdentity);
    GetDlgItem(IDC_EDIT3)->EnableWindow(2 == m_iIdentity);
    GetDlgItem(IDC_STATIC3)->EnableWindow(2 == m_iIdentity);
    GetDlgItem(IDC_BUTTON1)->EnableWindow(2 == m_iIdentity);


}

BEGIN_MESSAGE_MAP(CIdentityPropertyPage, CPropertyPage)
        //{{AFX_MSG_MAP(CIdentityPropertyPage)
        ON_EN_CHANGE(IDC_EDIT1, OnChange)
        ON_BN_CLICKED(IDC_BUTTON1, OnBrowse)
        ON_EN_CHANGE(IDC_EDIT2, OnChange)
        ON_EN_CHANGE(IDC_EDIT3, OnChange)
        ON_BN_CLICKED(IDC_RADIO1, OnChange)
        ON_BN_CLICKED(IDC_RADIO2, OnChange)
        ON_BN_CLICKED(IDC_RADIO3, OnChange)
        ON_BN_CLICKED(IDC_RADIO4, OnChange)
        ON_WM_HELPINFO()
        //}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CIdentityPropertyPage::OnBrowse()
{
    TCHAR szUser[128];

    if (g_util.InvokeUserBrowser(m_hWnd, szUser))
    {
        GetDlgItem(IDC_EDIT1)->SetWindowText(szUser);
        SetModified(TRUE);
    }
}

void CIdentityPropertyPage::OnChange()
{
        // TODO: Add your control notification handler code here
        UpdateData(TRUE);
        SetModified(TRUE);
}







BOOL CGeneralPropertyPage::OnHelpInfo(HELPINFO* pHelpInfo)
{
        // TODO: Add your message handler code here and/or call default

        if(-1 != pHelpInfo->iCtrlId)
        {
                WORD hiWord = 0x8000 | CGeneralPropertyPage::IDD;
                WORD loWord = pHelpInfo->iCtrlId;
                DWORD dwLong = MAKELONG(loWord,hiWord);

                WinHelp(dwLong, HELP_CONTEXTPOPUP);
                return TRUE;
        }

        else
        {
                return CPropertyPage::OnHelpInfo(pHelpInfo);
        }
}







BOOL CLocationPropertyPage::OnHelpInfo(HELPINFO* pHelpInfo)
{
        // TODO: Add your message handler code here and/or call default

        if(-1 != pHelpInfo->iCtrlId)
        {
                WORD hiWord = 0x8000 | CLocationPropertyPage::IDD;
                WORD loWord = pHelpInfo->iCtrlId;
                DWORD dwLong = MAKELONG(loWord,hiWord);

                WinHelp(dwLong, HELP_CONTEXTPOPUP);
                return TRUE;
        }

        else
        {
                return CPropertyPage::OnHelpInfo(pHelpInfo);
        }
}







BOOL CSecurityPropertyPage::OnHelpInfo(HELPINFO* pHelpInfo)
{
        // TODO: Add your message handler code here and/or call default

        if(-1 != pHelpInfo->iCtrlId)
        {
                WORD hiWord = 0x8000 | CSecurityPropertyPage::IDD;
                WORD loWord = pHelpInfo->iCtrlId;
                DWORD dwLong = MAKELONG(loWord,hiWord);

                WinHelp(dwLong, HELP_CONTEXTPOPUP);
                return TRUE;
        }

        else
        {
                return CPropertyPage::OnHelpInfo(pHelpInfo);
        }
}







BOOL CIdentityPropertyPage::OnHelpInfo(HELPINFO* pHelpInfo)
{
        // TODO: Add your message handler code here and/or call default

        if(-1 != pHelpInfo->iCtrlId)
        {
                WORD hiWord = 0x8000 | CIdentityPropertyPage::IDD;
                WORD loWord = pHelpInfo->iCtrlId;
                DWORD dwLong = MAKELONG(loWord,hiWord);

                WinHelp(dwLong, HELP_CONTEXTPOPUP);
                return TRUE;
        }

        else
        {
                return CPropertyPage::OnHelpInfo(pHelpInfo);
        }
}