[PATCH 2/2] Add a define for UNICODE_STRING_MAX_CHARS
Paul Vriens
Paul.Vriens.Wine at gmail.com
Mon Dec 14 06:58:24 CST 2009
---
dlls/kernel32/environ.c | 4 ++--
include/winnt.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/environ.c b/dlls/kernel32/environ.c
index aaa9d6e..b11f7bf 100644
--- a/dlls/kernel32/environ.c
+++ b/dlls/kernel32/environ.c
@@ -364,8 +364,8 @@ DWORD WINAPI ExpandEnvironmentStringsW( LPCWSTR src, LPWSTR dst, DWORD len )
RtlInitUnicodeString(&us_src, src);
/* make sure we don't overflow the maximum UNICODE_STRING size */
- if (len > 0x7fff)
- len = 0x7fff;
+ if (len > UNICODE_STRING_MAX_CHARS)
+ len = UNICODE_STRING_MAX_CHARS;
us_dst.Length = 0;
us_dst.MaximumLength = len * sizeof(WCHAR);
diff --git a/include/winnt.h b/include/winnt.h
index e2d1d1a..28409af 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -617,6 +617,8 @@ typedef struct _MEMORY_BASIC_INFORMATION
#define MAXWORD 0xffff
#define MAXDWORD 0xffffffff
+#define UNICODE_STRING_MAX_CHARS 32767
+
#define FIELD_OFFSET(type, field) \
((LONG)(INT_PTR)&(((type *)0)->field))
--
1.6.2.5
--------------040303090709020808020004--
More information about the wine-patches
mailing list