#include "precomp.h"
Go to the source code of this file.
◆ Dns_CreateStringCopy_W()
Definition at line 141 of file string.c.
142{
145
146
148 {
149
152 }
153
154
156
157
159 if (NameCopy)
160 {
161
163 }
164 else
165 {
166
168 }
169
170
171 return NameCopy;
172}
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INVALID_PARAMETER
PVOID WINAPI Dns_AllocZero(IN SIZE_T Size)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define RtlCopyMemory(Destination, Source, Length)
Referenced by SaBlob_CreateFromIp4(), SaBlob_Query(), and SaBlob_WriteNameOrAlias().
◆ Dns_GetBufferLengthForStringCopy()
Definition at line 176 of file string.c.
180{
181 ULONG OutputSize = 0;
182
183
185 {
186
188 {
189
191 }
192
193
195 {
196
198 }
200 {
201
202 OutputSize = 0;
203 }
204 else
205 {
206
208 0,
212 0,
215 }
216 }
218 {
219
221 {
222
224 }
225
226
228 {
229
230 OutputSize =
Size + 1;
231 }
233 {
234
236 0,
240 0) + 1) *
sizeof(
WCHAR);
241 }
243 {
244
245 OutputSize = 0;
246 }
247 }
249 {
250
251 OutputSize = 0;
252 }
253
254
255 return OutputSize;
256}
ACPI_SIZE strlen(const char *String)
#define WideCharToMultiByte
#define MultiByteToWideChar
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Referenced by Dns_StringCopy(), and SaBlob_CreateHostent().
◆ Dns_StringCopy()
Definition at line 17 of file string.c.
23{
26
27
28 if (!StringSize)
29 {
30
32 {
33
35 }
36 else
37 {
38
40 }
41 }
42
43
44 if (DestinationSize)
45 {
46
48 StringSize,
49 InputType,
50 OutputType);
51 if (*DestinationSize < DestSize)
52 {
53
55
56
57 *DestinationSize = DestSize;
58 return 0;
59 }
60 else if (!DestSize)
61 {
62
64 return 0;
65 }
66
67
68 *DestinationSize = DestSize;
69 }
70
71
73 {
74
76 {
77
79 0,
81 StringSize,
83 -1,
86 }
88 {
89
90 StringSize = StringSize *
sizeof(
WCHAR);
92
93
94 OutputSize = StringSize + 2;
95 }
97 {
98
99 OutputSize = 0;
100 }
101 }
103 {
104
106 {
107
109
110
111 OutputSize = StringSize + 1;
112 }
114 {
115
117 0,
119 StringSize,
121 -1) *
sizeof(
WCHAR) + 2;
122 }
124 {
125
126 OutputSize = 0;
127 }
128 }
130 {
131
132 OutputSize = 0;
133 }
134
135
136 return OutputSize;
137}
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
ULONG WINAPI Dns_GetBufferLengthForStringCopy(IN PVOID String, IN ULONG Size OPTIONAL, IN DWORD InputType, IN DWORD OutputType)
#define RtlMoveMemory(Destination, Source, Length)
#define ERROR_INVALID_DATA
Referenced by Dns_Ip4ReverseNameToAddress_W(), Dns_Ip4StringToAddress_W(), Dns_StringToAddressEx(), Dns_StringToDnsAddrEx(), and SaBlob_CreateHostent().