Module: wine
Branch: master
Commit: bbd355614654ccf49e0180797f565c103c19a1f1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bbd355614654ccf49e0180797…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com>
Date: Mon Oct 11 22:25:15 2010 +0100
gdi32: Constify some variables.
---
dlls/gdi32/bidi.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/gdi32/bidi.c b/dlls/gdi32/bidi.c
index 4ef0e99..297ce86 100644
--- a/dlls/gdi32/bidi.c
+++ b/dlls/gdi32/bidi.c
@@ -198,9 +198,9 @@ static int resolveParagraphs(WORD *types, int cch)
Breaks a paragraph into lines
- Input: Character count
+ Input: Array of line break flags
+ Character count
In/Out: Array of characters
- Array of line break flags
Returns the count of characters on the first line
@@ -209,7 +209,7 @@ static int resolveParagraphs(WORD *types, int cch)
occurs after the character in pszInput[n]. Breaks before the first
character are not allowed.
------------------------------------------------------------------------*/
-static int resolveLines(LPCWSTR pszInput, BOOL * pbrk, int cch)
+static int resolveLines(LPCWSTR pszInput, const BOOL * pbrk, int cch)
{
/* skip characters not of type LS */
int ich = 0;
@@ -289,14 +289,14 @@ static void resolveWhitespace(int baselevel, const WORD *pcls, BYTE *plevel, int
Implements the Line-by-Line phases of the Unicode Bidi Algorithm
Input: Count of characters
+ Array of character directions
Inp/Out: Input text
- Array of character directions
Array of levels
------------------------------------------------------------------------*/
-static void BidiLines(int baselevel, LPWSTR pszOutLine, LPCWSTR pszLine, WORD * pclsLine,
- BYTE * plevelLine, int cchPara, BOOL * pbrk)
+static void BidiLines(int baselevel, LPWSTR pszOutLine, LPCWSTR pszLine, const WORD * pclsLine,
+ BYTE * plevelLine, int cchPara, const BOOL * pbrk)
{
int cchLine = 0;
int done = 0;
Module: wine
Branch: master
Commit: 189cd59079eafc5b373a38cb24b39dec0c8048cc
URL: http://source.winehq.org/git/wine.git/?a=commit;h=189cd59079eafc5b373a38cb2…
Author: Juan Lang <juan.lang(a)gmail.com>
Date: Mon Oct 11 09:12:45 2010 -0700
iphlpapi: Use a helper function to get the DNS server list.
---
dlls/iphlpapi/iphlpapi_main.c | 68 +++++++++++++++++++++++++++++------------
1 files changed, 48 insertions(+), 20 deletions(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index ae2dd76..2869ce3 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -1539,6 +1539,46 @@ DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOr
return ret;
}
+/* Gets the DNS server list into the list beginning at list. Assumes that
+ * a single server address may be placed at list if *len is at least
+ * sizeof(IP_ADDR_STRING) long. Otherwise, list->Next is set to firstDynamic,
+ * and assumes that all remaining DNS servers are contiguously located
+ * beginning at firstDynamic. On input, *len is assumed to be the total number
+ * of bytes available for all DNS servers, and is ignored if list is NULL.
+ * On return, *len is set to the total number of bytes required for all DNS
+ * servers.
+ * Returns ERROR_BUFFER_OVERFLOW if *len is insufficient,
+ * ERROR_SUCCESS otherwise.
+ */
+static DWORD get_dns_server_list(PIP_ADDR_STRING list,
+ PIP_ADDR_STRING firstDynamic, DWORD *len)
+{
+ DWORD size;
+
+ initialise_resolver();
+ size = _res.nscount * sizeof(IP_ADDR_STRING);
+ if (!list || *len < size) {
+ *len = size;
+ return ERROR_BUFFER_OVERFLOW;
+ }
+ *len = size;
+ if (_res.nscount > 0) {
+ PIP_ADDR_STRING ptr;
+ int i;
+
+ for (i = 0, ptr = list; i < _res.nscount && ptr; i++, ptr = ptr->Next) {
+ toIPAddressString(_res.nsaddr_list[i].sin_addr.s_addr,
+ ptr->IpAddress.String);
+ if (i == _res.nscount - 1)
+ ptr->Next = NULL;
+ else if (i == 0)
+ ptr->Next = firstDynamic;
+ else
+ ptr->Next = (PIP_ADDR_STRING)((PBYTE)ptr + sizeof(IP_ADDR_STRING));
+ }
+ }
+ return ERROR_SUCCESS;
+}
/******************************************************************
* GetNetworkParams (IPHLPAPI.@)
@@ -1560,7 +1600,7 @@ DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOr
*/
DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
{
- DWORD ret, size;
+ DWORD ret, size, serverListSize;
LONG regReturn;
HKEY hKey;
@@ -1568,9 +1608,8 @@ DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
if (!pOutBufLen)
return ERROR_INVALID_PARAMETER;
- initialise_resolver();
- size = sizeof(FIXED_INFO) + (_res.nscount > 0 ? (_res.nscount - 1) *
- sizeof(IP_ADDR_STRING) : 0);
+ get_dns_server_list(NULL, NULL, &serverListSize);
+ size = sizeof(FIXED_INFO) + serverListSize - sizeof(IP_ADDR_STRING);
if (!pFixedInfo || *pOutBufLen < size) {
*pOutBufLen = size;
return ERROR_BUFFER_OVERFLOW;
@@ -1581,22 +1620,11 @@ DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
GetComputerNameExA(ComputerNameDnsHostname, pFixedInfo->HostName, &size);
size = sizeof(pFixedInfo->DomainName);
GetComputerNameExA(ComputerNameDnsDomain, pFixedInfo->DomainName, &size);
- if (_res.nscount > 0) {
- PIP_ADDR_STRING ptr;
- int i;
-
- for (i = 0, ptr = &pFixedInfo->DnsServerList; i < _res.nscount && ptr;
- i++, ptr = ptr->Next) {
- toIPAddressString(_res.nsaddr_list[i].sin_addr.s_addr,
- ptr->IpAddress.String);
- if (i == _res.nscount - 1)
- ptr->Next = NULL;
- else if (i == 0)
- ptr->Next = (PIP_ADDR_STRING)((LPBYTE)pFixedInfo + sizeof(FIXED_INFO));
- else
- ptr->Next = (PIP_ADDR_STRING)((PBYTE)ptr + sizeof(IP_ADDR_STRING));
- }
- }
+ get_dns_server_list(&pFixedInfo->DnsServerList,
+ (PIP_ADDR_STRING)((BYTE *)pFixedInfo + sizeof(FIXED_INFO)),
+ &serverListSize);
+ /* Assume the first DNS server in the list is the "current" DNS server: */
+ pFixedInfo->CurrentDnsServer = &pFixedInfo->DnsServerList;
pFixedInfo->NodeType = HYBRID_NODETYPE;
regReturn = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP", 0, KEY_READ, &hKey);