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.4 KiB

  1. /******************************************************************
  2. SrvProp.h -- Properties functions and class declarations
  3. MODULE:
  4. DhcpProv.dll
  5. DESCRIPTION:
  6. Contains macros and declaration for the properties action function type.
  7. Contains the declaration of the class modeling the DHCP_Server property.
  8. REVISION:
  9. 08/03/98 - created
  10. ******************************************************************/
  11. #ifndef _PROPS_H
  12. #define _PROPS_H
  13. //------------General Definitions--------------------
  14. #define PROVIDER_NAMESPACE_DHCP "root\\dhcp"
  15. #define SERVER_IP_ADDRESS L"127.0.0.1"
  16. //------------General Utility functions--------------
  17. BOOL inet_wstodw(CHString str, DHCP_IP_ADDRESS & IpAddress);
  18. BOOL dupDhcpBinaryData(DHCP_BINARY_DATA &src, DHCP_BINARY_DATA &dest);
  19. BOOL InstanceSetByteArray(CInstance *pInstance, const CHString& name, BYTE *bArray, DWORD dwSzArray);
  20. BOOL InstanceGetByteArray(CInstance *pInstance, const CHString& name, BYTE *&bArray, DWORD &dwSzArray);
  21. // this is a default DWORD property of the "out" CInstance
  22. #define RETURN_CODE_PROPERTY_NAME "ReturnValue"
  23. // macro for declaration of the property action functions (imposed prototype)
  24. #define MFN_PROPERTY_ACTION_DECL(fnName) \
  25. BOOL fnName(void *, \
  26. CInstance *, \
  27. CInstance *)
  28. // macro for the definition of the property action functions (imposed prototype)
  29. #define MFN_PROPERTY_ACTION_DEFN(fnName, pServerParams, pIn, pOut) \
  30. BOOL fnName(void *pServerParams, \
  31. CInstance *pIn, \
  32. CInstance *pOut)
  33. // property action function type
  34. typedef BOOL (*PFN_PROPERTY_ACTION)(void *pServerParams, CInstance *pIn, CInstance *pOut);
  35. // general class defining the DHCP_Server property.
  36. // the DHCP_Server_Property static table (defined in SrvScal.cpp) is made up by instances of this class
  37. class CDHCP_Property
  38. {
  39. public:
  40. WCHAR *m_wsPropName; // property name
  41. PFN_PROPERTY_ACTION m_pfnActionGet; // pointer to GET action function
  42. PFN_PROPERTY_ACTION m_pfnActionSet; // pointer to SET action function
  43. // constructor
  44. CDHCP_Property(const WCHAR *wsPropName, const PFN_PROPERTY_ACTION pfnActionGet, const PFN_PROPERTY_ACTION pfnActionSet);
  45. // destructor
  46. virtual ~CDHCP_Property();
  47. };
  48. #endif