Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8ae2690b
Commit
8ae2690b
authored
Jul 21, 2005
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add helper functions for converting string arrays into different
encodings.
parent
f8079b69
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
139 additions
and
0 deletions
+139
-0
wldap32.h
dlls/wldap32/wldap32.h
+139
-0
No files found.
dlls/wldap32/wldap32.h
View file @
8ae2690b
...
@@ -84,3 +84,142 @@ static inline void strfreeU( char *str )
...
@@ -84,3 +84,142 @@ static inline void strfreeU( char *str )
{
{
HeapFree
(
GetProcessHeap
(),
0
,
str
);
HeapFree
(
GetProcessHeap
(),
0
,
str
);
}
}
static
inline
DWORD
strarraylenA
(
LPSTR
*
strarray
)
{
LPSTR
*
p
=
strarray
;
while
(
*
p
)
p
++
;
return
p
-
strarray
;
}
static
inline
DWORD
strarraylenW
(
LPWSTR
*
strarray
)
{
LPWSTR
*
p
=
strarray
;
while
(
*
p
)
p
++
;
return
p
-
strarray
;
}
static
inline
DWORD
strarraylenU
(
char
**
strarray
)
{
char
**
p
=
strarray
;
while
(
*
p
)
p
++
;
return
p
-
strarray
;
}
static
inline
LPWSTR
*
strarrayAtoW
(
LPSTR
*
strarray
)
{
LPWSTR
*
strarrayW
=
NULL
;
DWORD
size
;
if
(
strarray
)
{
size
=
sizeof
(
WCHAR
*
)
*
(
strarraylenA
(
strarray
)
+
1
);
strarrayW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
strarrayW
)
{
LPSTR
*
p
=
strarray
;
LPWSTR
*
q
=
strarrayW
;
while
(
*
p
)
*
q
++
=
strAtoW
(
*
p
++
);
*
q
=
NULL
;
}
}
return
strarrayW
;
}
static
inline
LPSTR
*
strarrayWtoA
(
LPWSTR
*
strarray
)
{
LPSTR
*
strarrayA
=
NULL
;
DWORD
size
;
if
(
strarray
)
{
size
=
sizeof
(
LPSTR
)
*
(
strarraylenW
(
strarray
)
+
1
);
strarrayA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
strarrayA
)
{
LPWSTR
*
p
=
strarray
;
LPSTR
*
q
=
strarrayA
;
while
(
*
p
)
*
q
++
=
strWtoA
(
*
p
++
);
*
q
=
NULL
;
}
}
return
strarrayA
;
}
static
inline
char
**
strarrayWtoU
(
LPWSTR
*
strarray
)
{
char
**
strarrayU
=
NULL
;
DWORD
size
;
if
(
strarray
)
{
size
=
sizeof
(
char
*
)
*
(
strarraylenW
(
strarray
)
+
1
);
strarrayU
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
strarrayU
)
{
LPWSTR
*
p
=
strarray
;
char
**
q
=
strarrayU
;
while
(
*
p
)
*
q
++
=
strWtoU
(
*
p
++
);
*
q
=
NULL
;
}
}
return
strarrayU
;
}
static
inline
LPWSTR
*
strarrayUtoW
(
char
**
strarray
)
{
LPWSTR
*
strarrayW
=
NULL
;
DWORD
size
;
if
(
strarray
)
{
size
=
sizeof
(
WCHAR
*
)
*
(
strarraylenU
(
strarray
)
+
1
);
strarrayW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
strarrayW
)
{
char
**
p
=
strarray
;
LPWSTR
*
q
=
strarrayW
;
while
(
*
p
)
*
q
++
=
strUtoW
(
*
p
++
);
*
q
=
NULL
;
}
}
return
strarrayW
;
}
static
inline
void
strarrayfreeA
(
LPSTR
*
strarray
)
{
if
(
strarray
)
{
LPSTR
*
p
=
strarray
;
while
(
*
p
)
strfreeA
(
*
p
++
);
HeapFree
(
GetProcessHeap
(),
0
,
strarray
);
}
}
static
inline
void
strarrayfreeW
(
LPWSTR
*
strarray
)
{
if
(
strarray
)
{
LPWSTR
*
p
=
strarray
;
while
(
*
p
)
strfreeW
(
*
p
++
);
HeapFree
(
GetProcessHeap
(),
0
,
strarray
);
}
}
static
inline
void
strarrayfreeU
(
char
**
strarray
)
{
if
(
strarray
)
{
char
**
p
=
strarray
;
while
(
*
p
)
strfreeU
(
*
p
++
);
HeapFree
(
GetProcessHeap
(),
0
,
strarray
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment