home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / adsi / sampprov / cprops.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-29  |  3.3 KB  |  216 lines

  1. /*++
  2.  
  3. Copyright (c) 1996 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     CProps.h
  8.  
  9. Abstract:
  10.  
  11.     Property Cache Object
  12.     
  13. Author:
  14.  
  15. Environment:
  16.  
  17.     User mode
  18.  
  19. Revision History :
  20.  
  21. --*/
  22. #ifndef _CPROPS_H_
  23. #define _CPROPS_H_
  24.  
  25.  
  26. typedef struct _property{
  27.     WCHAR   szPropertyName[MAX_PATH];
  28.     DWORD   dwFlags;
  29.     DWORD   dwNumValues;        
  30.     DWORD   dwSyntaxId;         
  31.     PSampleDSOBJECT pSampleDSObject;      // Pointer to the SampleDS Object
  32. }PROPERTY, *PPROPERTY;
  33.  
  34. #define PROPERTY_NAME(pProperty)            pProperty->szPropertyName
  35. #define PROPERTY_VALUES(pProperty)          pProperty->lpValues
  36. #define PROPERTY_NUMVALUES(pProperty)       pProperty->dwNumValues
  37. #define PROPERTY_SYNTAX(pProperty)          pProperty->dwSyntaxId
  38. #define PROPERTY_SampleDSOBJECT(pProperty)  pProperty->pSampleDSObject
  39. #define PROPERTY_FLAGS(pProperty)           pProperty->dwFlags
  40.  
  41. #define CACHE_PROPERTY_MODIFIED        0x1
  42.  
  43. class CPropertyCache {
  44.  
  45. public:
  46.  
  47.     HRESULT
  48.     CPropertyCache::
  49.     addproperty(
  50.         LPWSTR szPropertyName,
  51.         DWORD  dwSyntaxId,
  52.         DWORD  dwNumValues,
  53.         PSampleDSOBJECT pSampleDSObject
  54.         );
  55.  
  56.     HRESULT
  57.     CPropertyCache::
  58.     updateproperty(
  59.         LPWSTR szPropertyName,
  60.         DWORD  dwSyntaxId,
  61.         DWORD  dwNumValues,
  62.         PSampleDSOBJECT pSampleDSObject,
  63.         BOOL fExplicit
  64.         );
  65.  
  66.     HRESULT
  67.     CPropertyCache::
  68.     findproperty(
  69.         LPWSTR szPropertyName,
  70.         PDWORD pdwIndex
  71.         );
  72.  
  73.     HRESULT
  74.     CPropertyCache::
  75.     getproperty(
  76.         LPWSTR szPropertyName,
  77.         PDWORD  pdwSyntaxId,
  78.         PDWORD  pdwNumValues,
  79.         PSampleDSOBJECT * ppSampleDSObject
  80.         );
  81.  
  82.     HRESULT
  83.     CPropertyCache::
  84.     unboundgetproperty(
  85.         LPWSTR szPropertyName,
  86.         PDWORD  pdwSyntaxId,
  87.         PDWORD  pdwNumValues,
  88.         PSampleDSOBJECT * ppSampleDSObject
  89.         );
  90.  
  91.     HRESULT
  92.     CPropertyCache::
  93.     putproperty(
  94.         LPWSTR szPropertyName,
  95.         DWORD  dwSyntaxId,
  96.         DWORD  dwNumValues,
  97.         PSampleDSOBJECT pSampleDSObject
  98.         );
  99.  
  100.     CPropertyCache::
  101.     CPropertyCache();
  102.  
  103.     CPropertyCache::
  104.     ~CPropertyCache();
  105.  
  106.     static
  107.     HRESULT
  108.     CPropertyCache::
  109.     createpropertycache(
  110.         CCoreADsObject FAR * pCoreADsObject,
  111.         CPropertyCache FAR * FAR * ppPropertyCache
  112.         );
  113.  
  114.     HRESULT
  115.     CPropertyCache::
  116.     unmarshallproperty(
  117.         LPWSTR szPropertyName,
  118.         LPBYTE lpValue,
  119.         DWORD  dwNumValues,
  120.         DWORD  dwSyntaxId,
  121.         BOOL fExplicit
  122.         );
  123.  
  124.     HRESULT
  125.     CPropertyCache::
  126.     SampleDSUnMarshallProperties(
  127.         HANDLE hOperationData,
  128.         BOOL fExplicit
  129.         );
  130.  
  131.  
  132.     HRESULT
  133.     CPropertyCache::
  134.     marshallproperty(
  135.         LPSampleDS_ATTR_INFO pAttrInfo,
  136.         LPWSTR szPropertyName,
  137.         LPBYTE lpValues,
  138.         DWORD  dwNumValues,
  139.         DWORD  dwSyntaxId
  140.         );
  141.  
  142.     HRESULT
  143.     CPropertyCache::
  144.     SampleDSMarshallProperties(
  145.        HANDLE hOperationData
  146.     );
  147.  
  148.  
  149.  
  150. protected:
  151.  
  152.     DWORD _dwMaxProperties;
  153.  
  154.  
  155.     PPROPERTY _pProperties;
  156.     DWORD   _cb;
  157.  
  158.     CCoreADsObject FAR * _pCoreADsObject;
  159. };
  160.  
  161. #endif
  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.