--- mstools/samples/ddeml/client/dialog.c 2018/08/09 18:21:24 1.1.1.2 +++ mstools/samples/ddeml/client/dialog.c 2018/08/09 18:25:39 1.1.1.4 @@ -1,3 +1,14 @@ + +/******************************************************************************\ +* This is a part of the Microsoft Source Code Samples. +* Copyright (C) 1993 Microsoft Corporation. +* All rights reserved. +* This source code is only intended as a supplement to +* Microsoft Development Tools and/or WinHelp documentation. +* See these sources for detailed information regarding the +* Microsoft samples programs. +\******************************************************************************/ + /*************************************************************************** * * * MODULE : dialog.c * @@ -155,7 +166,7 @@ LPARAM lParam) // count the existing conversations and allocate aHwnd cHwnd = 0; - hConv = NULL; + hConv = 0; while (hConv = DdeQueryNextServer((HCONVLIST)pmci->hConv, hConv)) cHwnd++; aHwnd = (HWND *)MyAlloc(cHwnd * sizeof(HWND)); @@ -163,7 +174,7 @@ LPARAM lParam) // save all the old conversation windows into aHwnd. pHwnd = aHwnd; - hConv = NULL; + hConv = 0; while (hConv = DdeQueryNextServer((HCONVLIST)pmci->hConv, hConv)) { DdeQueryConvInfo(hConv, QID_SYNC, &ci); *pHwnd++ = (HWND)ci.hUser; @@ -181,7 +192,7 @@ LPARAM lParam) // fixup windows corresponding to the new conversations. pmci->hConv = hConv; - hConv = NULL; + hConv = 0; while (hConv = DdeQueryNextServer((HCONVLIST)pmci->hConv, hConv)) { DdeQueryConvInfo(hConv, QID_SYNC, &ci); // preserve corresponding window by setting its list @@ -205,7 +216,7 @@ LPARAM lParam) // create any new windows needed - hConv = NULL; + hConv = 0; while (hConv = DdeQueryNextServer((HCONVLIST)pmci->hConv, hConv)) { DdeQueryConvInfo(hConv, QID_SYNC, &ci); if (ci.hUser) { @@ -370,7 +381,7 @@ LPARAM lParam) } GetDlgItemText(hwnd, IDEF_ITEM, szT, MAX_NAME); - pxact->hszItem = DdeCreateStringHandle(idInst, szT, NULL); + pxact->hszItem = DdeCreateStringHandle(idInst, szT, 0); pxact->hDdeData = 0; /* @@ -789,7 +800,7 @@ LPARAM lParam) BOOL APIENTRY ContextDlgProc( -HWND hwnd, +HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -803,6 +814,8 @@ LPARAM lParam) SetDlgItemInt(hwnd, IDEF_CODEPAGE, CCFilter.iCodePage, TRUE); SetDlgItemInt(hwnd, IDEF_LANG, CCFilter.dwLangID, FALSE); SetDlgItemInt(hwnd, IDEF_SECURITY, CCFilter.dwSecurity, FALSE); + CheckRadioButton(hwnd, IDRB_IL_ANON, IDRB_IL_DELEGATE, + IDRB_IL_ANON + (int)CCFilter.qos.ImpersonationLevel); return(1); break; @@ -819,6 +832,15 @@ LPARAM lParam) if (!fSuccess) return(0); CCFilter.dwSecurity = (DWORD)GetDlgItemInt(hwnd, IDEF_SECURITY, &fSuccess, FALSE); if (!fSuccess) return(0); + if (IsDlgButtonChecked(hwnd, IDRB_IL_ANON)) { + CCFilter.qos.ImpersonationLevel = SecurityAnonymous; + } else if (IsDlgButtonChecked(hwnd, IDRB_IL_ID)) { + CCFilter.qos.ImpersonationLevel = SecurityIdentification; + } else if (IsDlgButtonChecked(hwnd, IDRB_IL_IMP)) { + CCFilter.qos.ImpersonationLevel = SecurityImpersonation; + } else if (IsDlgButtonChecked(hwnd, IDRB_IL_DELEGATE)) { + CCFilter.qos.ImpersonationLevel = SecurityDelegation; + } // fall through case IDCANCEL: EndDialog(hwnd, 0); @@ -840,7 +862,7 @@ DWORD delay) delay = GetCurrentTime() + delay; while (GetCurrentTime() < delay) { - if (PeekMessage(&msg,NULL,NULL,NULL,PM_REMOVE)) { + if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); }