Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.2 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2001.
  5. //
  6. // File: Dataobj.cpp
  7. //
  8. // Contents: Wifi Policy management Snapin
  9. //
  10. //
  11. // History: TaroonM
  12. // 10/30/01
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "stdafx.h"
  16. #include "DataObj.h"
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22. ///////////////////////////////////////////////////////////////////////////////
  23. // Register used clipboard formats
  24. ///////////////////////////////////////////////////////////////////////////////
  25. // Snap-in NodeType in both GUID format and string format
  26. // Note - Typically there is a node type for each different object, sample
  27. // only uses one node type.
  28. unsigned int CSnapInClipboardFormats::m_cfNodeType = RegisterClipboardFormat(CCF_NODETYPE);
  29. unsigned int CSnapInClipboardFormats::m_cfNodeTypeString = RegisterClipboardFormat(CCF_SZNODETYPE);
  30. unsigned int CSnapInClipboardFormats::m_cfDisplayName = RegisterClipboardFormat(CCF_DISPLAY_NAME);
  31. unsigned int CSnapInClipboardFormats::m_cfCoClass = RegisterClipboardFormat(CCF_SNAPIN_CLASSID);
  32. unsigned int CSnapInClipboardFormats::m_cfDSObjectNames = RegisterClipboardFormat(CFSTR_DSOBJECTNAMES);
  33. unsigned int CSnapInClipboardFormats::m_cfWorkstation = RegisterClipboardFormat(SNAPIN_WORKSTATION);
  34. unsigned int CSnapInClipboardFormats::m_cfPolicyObject = RegisterClipboardFormat(CFSTR_WIFIPOLICYOBJECT);
  35. /////////////////////////////////////////////////////////////////////////////
  36. // Data object extraction helpers
  37. CLSID* ExtractClassID(LPDATAOBJECT lpDataObject)
  38. {
  39. OPT_TRACE(_T("ExtractClassID\n"));
  40. return Extract<CLSID>(lpDataObject, CSnapInClipboardFormats::m_cfCoClass);
  41. }
  42. GUID* ExtractNodeType(LPDATAOBJECT lpDataObject)
  43. {
  44. OPT_TRACE(_T("ExtractNodeType\n"));
  45. return Extract<GUID>(lpDataObject, CSnapInClipboardFormats::m_cfNodeType);
  46. }
  47. wchar_t* ExtractWorkstation(LPDATAOBJECT lpDataObject)
  48. {
  49. OPT_TRACE(_T("ExtractWorkstation\n"));
  50. return Extract<wchar_t>(lpDataObject, CSnapInClipboardFormats::m_cfWorkstation);
  51. }