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.

227 lines
3.9 KiB

  1. // Copyright (c) 1997-2002 Microsoft Corporation
  2. //
  3. // Module:
  4. //
  5. // Safe string function wrappers and implementation for Networking/IPsec
  6. // nsustring.h
  7. //
  8. // Abstract:
  9. //
  10. // Wrappers for strsafe.h and safe string functions
  11. //
  12. // Author:
  13. //
  14. // RaymondS 1 February-2002
  15. //
  16. // Environment:
  17. //
  18. // User mode
  19. //
  20. // Revision History:
  21. //
  22. #pragma once
  23. #ifndef __NSUSTRING_H__
  24. #define __NSUSTRING_H_
  25. #include "Nsu.h"
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. // (strsafe.h written by Reiner Fink)
  30. #ifdef UNICODE
  31. #define NsuStringCopy NsuStringCopyW
  32. #define NsuStringDup NsuStringDupW
  33. #define NsuStringCat NsuStringCatW
  34. #define NsuStringSprint NsuStringSprintW
  35. #define NsuStringSprintFailSafe NsuStringSprintFailSafeW
  36. #define NsuStringVSprintFailSafe NsuStringVSprintFailSafeW
  37. #define NsuStringLen NsuStringLenW
  38. #define NsuStringFind NsuStringFindW
  39. #else
  40. #define NsuStringCopy NsuStringCopyA
  41. #define NsuStringDup NsuStringDupA
  42. #define NsuStringCat NsuStringCatA
  43. #define NsuStringSprint NsuStringSprintA
  44. #define NsuStringSprintFailSafe NsuStringSprintFailSafeA
  45. #define NsuStringVSprintFailSafe NsuStringVSprintFailSafeA
  46. #define NsuStringLen NsuStringLenA
  47. #define NsuStringFind NsuStringFindA
  48. #endif
  49. DWORD
  50. WINAPI
  51. NsuStringCopyW(
  52. OUT LPWSTR pszDest,
  53. IN size_t cchDest,
  54. IN LPCWSTR pszSrc
  55. );
  56. DWORD
  57. WINAPI
  58. NsuStringCopyA(
  59. OUT LPSTR pszDest,
  60. IN size_t cchDest,
  61. IN LPCSTR pszSrc
  62. );
  63. DWORD
  64. WINAPI
  65. NsuStringCopyAtoWAlloc(
  66. OUT LPWSTR* ppszDest,
  67. IN size_t cchLimit,
  68. IN LPCSTR pszSrc
  69. );
  70. DWORD
  71. WINAPI
  72. NsuStringCopyWtoAAlloc(
  73. OUT LPSTR* ppszDest,
  74. IN size_t cbLimit,
  75. IN LPCWSTR pszSrc
  76. );
  77. DWORD
  78. WINAPI
  79. NsuStringCopyWtoA(
  80. OUT LPSTR pszDest,
  81. IN size_t cbDest,
  82. IN LPCWSTR pszSrc
  83. );
  84. DWORD
  85. WINAPI
  86. NsuStringCopyAtoW(
  87. OUT LPWSTR pszDest,
  88. IN size_t cchDest,
  89. IN LPCSTR pszSrc
  90. );
  91. DWORD
  92. WINAPI
  93. NsuStringDupW(
  94. OUT LPWSTR* ppszDest,
  95. IN size_t cchLimit,
  96. IN LPCWSTR pszSrc
  97. );
  98. DWORD
  99. WINAPI
  100. NsuStringDupA(
  101. OUT LPSTR* ppszDest,
  102. IN size_t cchLimit,
  103. IN LPCSTR pszSrc
  104. );
  105. DWORD
  106. WINAPI
  107. NsuStringCatW(
  108. OUT LPWSTR pszDest,
  109. IN size_t cchDest,
  110. IN LPCWSTR pszSrc
  111. );
  112. DWORD
  113. WINAPI
  114. NsuStringCatA(
  115. OUT LPSTR pszDest,
  116. IN size_t cchDest,
  117. IN LPCSTR pszSrc
  118. );
  119. DWORD
  120. WINAPI
  121. NsuStringSprintW(
  122. OUT LPWSTR pszDest,
  123. IN size_t cchDest,
  124. IN LPCWSTR pszFormat,
  125. ...
  126. );
  127. DWORD
  128. WINAPI
  129. NsuStringSprintA(
  130. OUT LPSTR pszDest,
  131. IN size_t cchDest,
  132. IN LPCSTR pszFormat,
  133. ...
  134. );
  135. VOID
  136. WINAPI
  137. NsuStringSprintFailSafeW(
  138. OUT LPWSTR pszDest,
  139. IN size_t cchDest,
  140. IN LPCWSTR pszFormat,
  141. ...
  142. );
  143. VOID
  144. WINAPI
  145. NsuStringSprintFailSafeA(
  146. OUT LPSTR pszDest,
  147. IN size_t cchDest,
  148. IN LPCSTR pszFormat,
  149. ...
  150. );
  151. VOID
  152. WINAPI
  153. NsuStringVSprintFailSafeW(
  154. OUT LPWSTR pszDest,
  155. IN size_t cchDest,
  156. IN LPCWSTR pszFormat,
  157. IN va_list vaArguments
  158. );
  159. VOID
  160. WINAPI
  161. NsuStringVSprintFailSafeA(
  162. OUT LPSTR pszDest,
  163. IN size_t cchDest,
  164. IN LPCSTR pszFormat,
  165. IN va_list vaArguments
  166. );
  167. DWORD
  168. WINAPI
  169. NsuStringLenW(
  170. IN LPCWSTR pszStr,
  171. OUT size_t* pcchStrLen
  172. );
  173. DWORD
  174. WINAPI
  175. NsuStringLenA(
  176. IN LPCSTR pszStr,
  177. OUT size_t* pcbStrLen
  178. );
  179. DWORD
  180. WINAPI
  181. NsuStringFindW(
  182. IN LPCWSTR pszStrToSearch,
  183. IN LPCWSTR pszStrToFind,
  184. IN BOOL bIsCaseSensitive,
  185. OUT LPCWSTR* ppszStartOfMatch
  186. );
  187. DWORD
  188. WINAPI
  189. NsuStringFindA(
  190. IN LPCSTR pszStrToSearch,
  191. IN LPCSTR pszStrToFind,
  192. IN BOOL bIsCaseSensitive,
  193. OUT LPCSTR* ppszStartOfMatch
  194. );
  195. #ifdef __cplusplus
  196. }
  197. #endif
  198. #endif /* #ifdef __NSUSTRING_H__ */