Leaked source code of windows server 2003
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.

69 lines
1.7 KiB

  1. //Copyright (c) Microsoft Corporation. All rights reserved.
  2. // EnumData.h: interface for the CEnumData class.
  3. //
  4. //////////////////////////////////////////////////////////////////////
  5. #if !defined(AFX_ENUMDATA_H__FE9E48A8_A014_11D1_855C_00A0C944138C__INCLUDED_)
  6. #define AFX_ENUMDATA_H__FE9E48A8_A014_11D1_855C_00A0C944138C__INCLUDED_
  7. #if _MSC_VER >= 1000
  8. #pragma once
  9. #endif // _MSC_VER >= 1000
  10. struct PIdNode
  11. {
  12. PIdNode *pNextPId;
  13. WCHAR *lpszProcessName;
  14. DWORD dwPId;
  15. PIdNode(DWORD dwId, WCHAR *lpszName ) : pNextPId( NULL )
  16. {
  17. dwPId = dwId;
  18. lpszProcessName = new WCHAR [ lstrlenW( lpszName ) + 1 ];
  19. if (lpszProcessName)
  20. {
  21. lstrcpyW( lpszProcessName, lpszName ); // Size already calculated.
  22. }
  23. }
  24. ~PIdNode()
  25. {
  26. if (lpszProcessName)
  27. {
  28. delete [] lpszProcessName;
  29. }
  30. }
  31. };
  32. class CEnumData
  33. {
  34. public:
  35. CEnumData();
  36. virtual ~CEnumData();
  37. void Add( LPWSTR lpszName, LPWSTR lpszDom, LPWSTR lpszPeerHostName, SYSTEMTIME lgnTime, LONG lId );
  38. void Add( LONG lId, DWORD dwId, WCHAR *lpszName );
  39. struct CNode
  40. {
  41. CNode* pNext;
  42. WCHAR* lpszUserName;
  43. WCHAR* lpszDomain;
  44. WCHAR* lpszPeerHostName;
  45. SYSTEMTIME logonTime;
  46. LONG lUniqueId;
  47. PIdNode *pProcessesHead;
  48. PIdNode *pProcessesTail;
  49. CNode( LPWSTR, LPWSTR, LPWSTR, SYSTEMTIME, LONG );
  50. ~CNode();
  51. };
  52. //bool GetNext( LPWSTR* lplpszName );
  53. bool GetNext( CNode** );
  54. void Reset();
  55. private:
  56. CNode* m_pPosition;
  57. CNode* m_pHead;
  58. };
  59. #endif // !defined(AFX_ENUMDATA_H__FE9E48A8_A014_11D1_855C_00A0C944138C__INCLUDED_)