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.

140 lines
4.0 KiB

  1. /************************************************************************
  2. // Copyright (c) 1998. C-Cube Microsystems.
  3. // All Rights Reserved.
  4. // This source code and related information are copyrighted
  5. // proprietory technology of C-Cube Microsystems,
  6. // ("C-Cube") released under a specific license for its
  7. // confidentiality and protection as C-Cube's trade secret.
  8. //
  9. // Unauthorized disclosure, exposure, duplication, copying,
  10. // distribution or any other use than that specifically
  11. // authorized by C-Cube is strictly prohibited.
  12. //
  13. // Filename: RegistryApi.h
  14. //
  15. // Description:
  16. // This module contains registry related functions.
  17. //
  18. // C H A N G E R E C O R D
  19. //
  20. // Date Initials Description
  21. // -------- -------- -----------------------------------------------
  22. // 06/10/98 Satish Created this file.
  23. // 08/06/98 Landon Converted to WDM Driver.
  24. // 09/09/98 Satish Changed wcsicmp to _wcsicmp.
  25. // 10/30/98 JChapman Merged with code for multiple board support
  26. //
  27. ************************************************************************/
  28. #ifndef _REGAPI_HEADER
  29. #define _REGAPI_HEADER
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #ifndef DRIVER
  34. #ifndef DllExport
  35. #define DllExport __declspec (dllexport)
  36. #endif
  37. #else
  38. #ifdef DllExport
  39. #undef DllExport
  40. #endif
  41. #define DllExport
  42. #endif
  43. // My own UNICODE independant definitions
  44. #ifdef UNICODE
  45. #define STRCPY wcscpy
  46. #define STRCAT wcscat
  47. #define STRCMP wcscmp
  48. #define STRLEN wcslen
  49. #define STRICMP _wcsicmp
  50. #else
  51. #define STRCPY strcpy
  52. #define STRCAT strcat
  53. #define STRCMP strcmp
  54. #define STRLEN strlen
  55. #define STRICMP stricmp
  56. #endif
  57. //----------------------
  58. // Constant definitions
  59. //----------------------
  60. #ifndef DRIVER
  61. #define DEFAULT_REGISTY_PATH TEXT("SOFTWARE\\C-Cube Microsystems\\2Real")
  62. #else
  63. #define DEFAULT_REGISTY_PATH TEXT("SOFTWARE\\C-Cube Microsystems\\2Real")
  64. #endif
  65. //----------------------------
  66. // External data declarations
  67. //----------------------------
  68. //----------------------------
  69. // Function declarations.
  70. //----------------------------
  71. int // Return value read from registry.
  72. REG_GetPrivateProfileInt( // Read int value from registry.
  73. PTSTR pszSection, // Pointer to section.
  74. PTSTR pszEntry, // Pointer to entry.
  75. int nDefault, // Default value.
  76. HANDLE pszPath); // Registry path. If NULL default path is used.
  77. BOOL // Return TRUE on success, else FALSE.
  78. REG_WritePrivateProfileInt( // Write int value to registry.
  79. PTSTR pszSection, // Pointer to section.
  80. PTSTR pszEntry, // Pointer to entry.
  81. int nValue, // Value to be written.
  82. HANDLE pszPath); // Registry path. If NULL default path is used.
  83. long // Return value read from registry.
  84. REG_GetPrivateProfileLong( // Read int value from registry.
  85. PTSTR pszSection, // Pointer to section.
  86. PTSTR pszEntry, // Pointer to entry.
  87. long lDefault, // Default value.
  88. HANDLE pszPath); // Registry path. If NULL default path is used.
  89. BOOL // Return TRUE on success, else FALSE.
  90. REG_WritePrivateProfileLong( // Write int value to registry.
  91. PTSTR pszSection, // Pointer to section.
  92. PTSTR pszEntry, // Pointer to entry.
  93. long lValue, // Value to be written.
  94. HANDLE pszPath); // Registry path. If NULL default path is used.
  95. BOOL // Return # of chars read.
  96. REG_GetPrivateProfileString( // Read string from registry.
  97. PTSTR pszSection, // Pointer to section.
  98. PTSTR pszEntry, // Pointer to entry.
  99. PTSTR pszDefault, // Pointer to default string.
  100. PTSTR pString, // Pointer to get the string.
  101. int nStringSize, // string size in bytes.
  102. HANDLE pszPath); // Registry path. If NULL default path is used.
  103. BOOL // Return # of chars written.
  104. REG_WritePrivateProfileString( // Write the string to registry.
  105. PTSTR pszSection, // Pointer to section.
  106. PTSTR pszEntry, // Pointer to entry.
  107. PTSTR pString, // Pointer to get the string.
  108. HANDLE pszPath); // Registry path. If NULL default path is used.
  109. #ifndef DRIVER
  110. #endif
  111. #ifdef __cplusplus
  112. }
  113. #endif
  114. #endif