home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / KEYS.H < prev    next >
Text File  |  1997-10-25  |  3KB  |  116 lines

  1. /*++
  2.  
  3. Copyright (c) 1997  Microsoft Corporation
  4.  
  5. Module Name:    keys.h
  6.  
  7. Abstract:
  8.  
  9.     header file for reusable interface
  10.  
  11. --*/
  12.  
  13. // Abstracted pointer
  14. typedef void * HKEYLIST;
  15.  
  16. //
  17. // Retrieves and decodes inbound form data.  Builds list of keys, and
  18. // pointers to data within a content file.  Returns handle to first
  19. // element in the list.
  20. //
  21.  
  22. HKEYLIST GetKeyList(IN EXTENSION_CONTROL_BLOCK *pECB);
  23.  
  24. //
  25. // GetKeyInfo extracts the key name and content values from the
  26. // supplied key, and returns a handle to the next key in the list.
  27. //
  28. // The length is the exact length of the inbound data, but a NULL
  29. // is appended to the data.  For example, a text string of five
  30. // characters has a *pdwLength=5, but GetKeyBuffer returns at
  31. // least a 6 byte buffer--the five characters and a NULL.
  32. //
  33.  
  34. HKEYLIST GetKeyInfo(IN HKEYLIST hKey, OUT LPCSTR *plpszKeyName, 
  35.                     OUT LPDWORD pdwLength, OUT BOOL *pbHasCtrlChars,
  36.                     OUT LPINT pnInstance);
  37.  
  38. //
  39. // GetKeyBuffer returns a pointer to the buffer holding data.
  40. // Depending on the implementation in keys.cpp, this may or may not
  41. // be a buffer the exact size of the data (it may be bigger).
  42. //
  43. // The data is zero-terminated.
  44. //
  45.  
  46. LPBYTE GetKeyBuffer(IN HKEYLIST hKey);
  47.  
  48.  
  49. //
  50. // FindKey sequentially searches the linked list for a specific key.
  51. // The return handle can be used with GetKeyInfo to get more details.
  52. // FindKey returns the very first occurance of a duplicate key.
  53. // Also, it searches from the given key which need not be the head
  54. // key.
  55. //
  56.  
  57. HKEYLIST FindKey(IN HKEYLIST hKeyList, IN LPCSTR lpszSearchName);
  58.  
  59.  
  60. //
  61. // FreeKeyList releases all of the memory associated with a key list.
  62. // Also, content resources are deleted.
  63. //
  64.  
  65. void FreeKeyList(IN HKEYLIST hKeyList);
  66.  
  67.  
  68. //
  69. // GetKeyOffset returns the offset within the internal buffer or
  70. // the content file.  Under normal circumstances, use GetKeyInfo
  71. // and GetKeyBuffer instead of directly accessing the buffer.
  72. //
  73.  
  74. DWORD GetKeyOffset(IN HKEYLIST hKey);
  75.  
  76.  
  77. #ifdef USE_TEMPORARY_FILES
  78. //
  79. // GetContentFile returns the name of the temporary file used
  80. // to save the content.  The temporary file may be open.
  81. //
  82.  
  83. LPCTSTR GetContentFile(IN HKEYLIST hKeyList);
  84.  
  85. //
  86. // CloseContentFile forces the content file to be closed.  This
  87. // allows you to pass the file to something else that may open
  88. // it.  Call OpenContentFile before calling any other key
  89. // function.
  90. //
  91.  
  92. void CloseContentFile(IN HKEYLIST hKeyList);
  93.  
  94.  
  95. //
  96. // OpenContentFile forces the content file to be reopened.
  97. // GetKeyBuffer will fail if the content file was closed by
  98. // CloseContentFile, but not reopened.
  99. //
  100.  
  101. void OpenContentFile(IN HKEYLIST hKeyList);
  102.  
  103. #else
  104.  
  105. //
  106. // GetDataBuffer returns a pointer to the start of the data
  107. // buffer which holds all content.  This function is not
  108. // particularly useful -- use GetKeyBuffer to get a pointer
  109. // to the buffer for a specific key.
  110. //
  111.  
  112. LPBYTE GetDataBuffer(IN HKEYLIST hKey);
  113.  
  114. #endif
  115.  
  116.