ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2010
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[cwittich] 46299: [RPCRT4] partial rpcrt4 sync to wine 1.1.41
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Mar 21 15:53:49 2010 New Revision: 46299 URL:
http://svn.reactos.org/svn/reactos?rev=46299&view=rev
Log: [RPCRT4] partial rpcrt4 sync to wine 1.1.41 Modified: trunk/reactos/dll/win32/rpcrt4/ndr_contexthandle.c trunk/reactos/dll/win32/rpcrt4/ndr_fullpointer.c trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c trunk/reactos/dll/win32/rpcrt4/ndr_misc.h Modified: trunk/reactos/dll/win32/rpcrt4/ndr_contexthandle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_conte…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_contexthandle.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_contexthandle.c [iso-8859-1] Sun Mar 21 15:53:49 2010 @@ -59,7 +59,7 @@ static struct context_handle_entry *get_context_entry(NDR_CCONTEXT CContext) { - struct context_handle_entry *che = (struct context_handle_entry*) CContext; + struct context_handle_entry *che = CContext; if (che->magic != NDR_CONTEXT_HANDLE_MAGIC) return NULL; @@ -111,7 +111,7 @@ } else { - ndr_context_handle *wire_data = (ndr_context_handle *)pBuff; + ndr_context_handle *wire_data = pBuff; wire_data->attributes = 0; wire_data->uuid = GUID_NULL; } Modified: trunk/reactos/dll/win32/rpcrt4/ndr_fullpointer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_fullp…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_fullpointer.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_fullpointer.c [iso-8859-1] Sun Mar 21 15:53:49 2010 @@ -161,6 +161,9 @@ { TRACE("(%p, 0x%x, %d, %p)\n", pXlatTables, RefId, QueryType, ppPointer); + if (!RefId) + return 1; + expand_pointer_table_if_necessary(pXlatTables, RefId); pXlatTables->NextRefId = max(RefId + 1, pXlatTables->NextRefId); Modified: trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_marsh…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_marshall.c [iso-8859-1] Sun Mar 21 15:53:49 2010 @@ -39,6 +39,7 @@ #include "ndr_misc.h" #include "rpcndr.h" +#include "ndrtypes.h" #include "wine/unicode.h" #include "wine/rpcfc.h" @@ -112,6 +113,8 @@ #define NDR_POINTER_ID(pStubMsg) (NDR_POINTER_ID_BASE + ((pStubMsg)->UniquePtrCount++) * 4) #define NDR_TABLE_SIZE 128 #define NDR_TABLE_MASK 127 + +#define NDRSContextFromValue(user_context) (NDR_SCONTEXT)((char *)(user_context) - (char *)NDRSContextValue((NDR_SCONTEXT)NULL)) static unsigned char *WINAPI NdrBaseTypeMarshall(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING); static unsigned char *WINAPI NdrBaseTypeUnmarshall(PMIDL_STUB_MESSAGE, unsigned char **, PFORMAT_STRING, unsigned char); @@ -548,7 +551,8 @@ } break; default: - FIXME("unknown conformance type %x\n", pFormat[0] & 0xf0); + FIXME("unknown conformance type %x, expect crash.\n", pFormat[0] & 0xf0); + goto finish_conf; } switch (pFormat[1]) { @@ -935,7 +939,7 @@ if (type == RPC_FC_FP) NdrFullPointerInsertRefId(pStubMsg->FullPtrXlatTables, pointer_id, - base_ptr_val); + *pPointer); } TRACE("pointer=%p\n", *pPointer); @@ -1778,7 +1782,7 @@ break; case RPC_FC_C_CSTRING: case RPC_FC_C_WSTRING: - if (pFormat[0] == RPC_FC_C_CSTRING) + if (fc == RPC_FC_C_CSTRING) { TRACE("string=%s\n", debugstr_a((const char *)pMemory)); pStubMsg->ActualCount = strlen((const char *)pMemory)+1; @@ -1789,7 +1793,7 @@ pStubMsg->ActualCount = strlenW((LPCWSTR)pMemory)+1; } - if (fc == RPC_FC_STRING_SIZED) + if (pFormat[1] == RPC_FC_STRING_SIZED) pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 2, 0); else pStubMsg->MaxCount = pStubMsg->ActualCount; @@ -2692,17 +2696,33 @@ safe_copy_to_buffer(pStubMsg, pMemory, 4); pMemory += 4; break; + case RPC_FC_FLOAT: + TRACE("float=%f <= %p\n", *(float*)pMemory, pMemory); + safe_copy_to_buffer(pStubMsg, pMemory, sizeof(float)); + pMemory += sizeof(float); + break; case RPC_FC_HYPER: TRACE("longlong=%s <= %p\n", wine_dbgstr_longlong(*(ULONGLONG*)pMemory), pMemory); safe_copy_to_buffer(pStubMsg, pMemory, 8); pMemory += 8; break; + case RPC_FC_DOUBLE: + TRACE("double=%f <= %p\n", *(double*)pMemory, pMemory); + safe_copy_to_buffer(pStubMsg, pMemory, sizeof(double)); + pMemory += sizeof(double); + break; + case RPC_FC_RP: + case RPC_FC_UP: + case RPC_FC_OP: + case RPC_FC_FP: case RPC_FC_POINTER: { unsigned char *saved_buffer; int pointer_buffer_mark_set = 0; TRACE("pointer=%p <= %p\n", *(unsigned char**)pMemory, pMemory); TRACE("pStubMsg->Buffer before %p\n", pStubMsg->Buffer); + if (*pFormat != RPC_FC_POINTER) + pPointer = pFormat; if (*pPointer != RPC_FC_RP) ALIGN_POINTER_CLEAR(pStubMsg->Buffer, 4); saved_buffer = pStubMsg->Buffer; @@ -2724,7 +2744,10 @@ safe_buffer_increment(pStubMsg, 4); /* for pointer ID */ } TRACE("pStubMsg->Buffer after %p\n", pStubMsg->Buffer); - pPointer += 4; + if (*pFormat == RPC_FC_POINTER) + pPointer += 4; + else + pFormat += 4; pMemory += sizeof(void *); break; } @@ -2821,16 +2844,32 @@ TRACE("long=%d => %p\n", *(DWORD*)pMemory, pMemory); pMemory += 4; break; + case RPC_FC_FLOAT: + safe_copy_from_buffer(pStubMsg, pMemory, sizeof(float)); + TRACE("float=%f => %p\n", *(float*)pMemory, pMemory); + pMemory += sizeof(float); + break; case RPC_FC_HYPER: safe_copy_from_buffer(pStubMsg, pMemory, 8); TRACE("longlong=%s => %p\n", wine_dbgstr_longlong(*(ULONGLONG*)pMemory), pMemory); pMemory += 8; break; + case RPC_FC_DOUBLE: + safe_copy_from_buffer(pStubMsg, pMemory, sizeof(double)); + TRACE("double=%f => %p\n", *(double*)pMemory, pMemory); + pMemory += sizeof(double); + break; + case RPC_FC_RP: + case RPC_FC_UP: + case RPC_FC_OP: + case RPC_FC_FP: case RPC_FC_POINTER: { unsigned char *saved_buffer; int pointer_buffer_mark_set = 0; TRACE("pointer => %p\n", pMemory); + if (*pFormat != RPC_FC_POINTER) + pPointer = pFormat; if (*pPointer != RPC_FC_RP) ALIGN_POINTER(pStubMsg->Buffer, 4); saved_buffer = pStubMsg->Buffer; @@ -2852,7 +2891,10 @@ if (*pPointer != RPC_FC_RP) safe_buffer_increment(pStubMsg, 4); /* for pointer ID */ } - pPointer += 4; + if (*pFormat == RPC_FC_POINTER) + pPointer += 4; + else + pFormat += 4; pMemory += sizeof(void *); break; } @@ -2946,14 +2988,22 @@ case RPC_FC_LONG: case RPC_FC_ULONG: case RPC_FC_ENUM32: + case RPC_FC_FLOAT: safe_buffer_length_increment(pStubMsg, 4); pMemory += 4; break; case RPC_FC_HYPER: + case RPC_FC_DOUBLE: safe_buffer_length_increment(pStubMsg, 8); pMemory += 8; break; + case RPC_FC_RP: + case RPC_FC_UP: + case RPC_FC_OP: + case RPC_FC_FP: case RPC_FC_POINTER: + if (*pFormat != RPC_FC_POINTER) + pPointer = pFormat; if (!pStubMsg->IgnoreEmbeddedPointers) { int saved_buffer_length = pStubMsg->BufferLength; @@ -2970,7 +3020,10 @@ ALIGN_LENGTH(pStubMsg->BufferLength, 4); safe_buffer_length_increment(pStubMsg, 4); } - pPointer += 4; + if (*pFormat == RPC_FC_POINTER) + pPointer += 4; + else + pFormat += 4; pMemory += sizeof(void*); break; case RPC_FC_ALIGNM2: @@ -3049,14 +3102,25 @@ case RPC_FC_ULONG: case RPC_FC_ENUM16: case RPC_FC_ENUM32: + case RPC_FC_FLOAT: pMemory += 4; break; case RPC_FC_HYPER: + case RPC_FC_DOUBLE: pMemory += 8; break; + case RPC_FC_RP: + case RPC_FC_UP: + case RPC_FC_OP: + case RPC_FC_FP: case RPC_FC_POINTER: + if (*pFormat != RPC_FC_POINTER) + pPointer = pFormat; NdrPointerFree(pStubMsg, *(unsigned char**)pMemory, pPointer); - pPointer += 4; + if (*pFormat == RPC_FC_POINTER) + pPointer += 4; + else + pFormat += 4; pMemory += sizeof(void *); break; case RPC_FC_ALIGNM2: @@ -3137,17 +3201,25 @@ case RPC_FC_LONG: case RPC_FC_ULONG: case RPC_FC_ENUM32: + case RPC_FC_FLOAT: size += 4; safe_buffer_increment(pStubMsg, 4); break; case RPC_FC_HYPER: + case RPC_FC_DOUBLE: size += 8; safe_buffer_increment(pStubMsg, 8); break; + case RPC_FC_RP: + case RPC_FC_UP: + case RPC_FC_OP: + case RPC_FC_FP: case RPC_FC_POINTER: { unsigned char *saved_buffer; int pointer_buffer_mark_set = 0; + if (*pFormat != RPC_FC_POINTER) + pPointer = pFormat; if (*pPointer != RPC_FC_RP) ALIGN_POINTER(pStubMsg->Buffer, 4); saved_buffer = pStubMsg->Buffer; @@ -3170,7 +3242,10 @@ if (*pPointer != RPC_FC_RP) safe_buffer_increment(pStubMsg, 4); /* for pointer ID */ } - pPointer += 4; + if (*pFormat == RPC_FC_POINTER) + pPointer += 4; + else + pFormat += 4; size += sizeof(void *); break; } @@ -3232,13 +3307,21 @@ case RPC_FC_ULONG: case RPC_FC_ENUM16: case RPC_FC_ENUM32: + case RPC_FC_FLOAT: size += 4; break; case RPC_FC_HYPER: + case RPC_FC_DOUBLE: size += 8; break; + case RPC_FC_RP: + case RPC_FC_UP: + case RPC_FC_OP: + case RPC_FC_FP: case RPC_FC_POINTER: size += sizeof(void *); + if (*pFormat != RPC_FC_POINTER) + pFormat += 4; break; case RPC_FC_ALIGNM2: ALIGN_LENGTH(size, 2); @@ -6687,10 +6770,19 @@ } TRACE("flags: 0x%02x\n", pFormat[1]); - if (pFormat[1] & 0x80) - NdrClientContextMarshall(pStubMsg, *(NDR_CCONTEXT **)pMemory, FALSE); + if (pStubMsg->IsClient) + { + if (pFormat[1] & HANDLE_PARAM_IS_VIA_PTR) + NdrClientContextMarshall(pStubMsg, *(NDR_CCONTEXT **)pMemory, FALSE); + else + NdrClientContextMarshall(pStubMsg, pMemory, FALSE); + } else - NdrClientContextMarshall(pStubMsg, pMemory, FALSE); + { + NDR_SCONTEXT ctxt = NDRSContextFromValue(pMemory); + NDR_RUNDOWN rundown = pStubMsg->StubDesc->apfnNdrRundownRoutines[pFormat[2]]; + NdrServerContextNewMarshall(pStubMsg, ctxt, rundown, pFormat); + } return NULL; } @@ -6714,10 +6806,22 @@ } TRACE("flags: 0x%02x\n", pFormat[1]); - /* [out]-only or [ret] param */ - if ((pFormat[1] & 0x60) == 0x20) - **(NDR_CCONTEXT **)ppMemory = NULL; - NdrClientContextUnmarshall(pStubMsg, *(NDR_CCONTEXT **)ppMemory, pStubMsg->RpcMsg->Handle); + if (pStubMsg->IsClient) + { + /* [out]-only or [ret] param */ + if ((pFormat[1] & (HANDLE_PARAM_IS_IN|HANDLE_PARAM_IS_OUT)) == HANDLE_PARAM_IS_OUT) + **(NDR_CCONTEXT **)ppMemory = NULL; + NdrClientContextUnmarshall(pStubMsg, *(NDR_CCONTEXT **)ppMemory, pStubMsg->RpcMsg->Handle); + } + else + { + NDR_SCONTEXT ctxt; + ctxt = NdrServerContextNewUnmarshall(pStubMsg, pFormat); + if (pFormat[1] & HANDLE_PARAM_IS_VIA_PTR) + *(void **)ppMemory = NDRSContextValue(ctxt); + else + *(void **)ppMemory = *NDRSContextValue(ctxt); + } return NULL; } Modified: trunk/reactos/dll/win32/rpcrt4/ndr_misc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_misc.…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_misc.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_misc.h [iso-8859-1] Sun Mar 21 15:53:49 2010 @@ -62,6 +62,6 @@ extern const NDR_MEMORYSIZE NdrMemorySizer[]; extern const NDR_FREE NdrFreer[]; -unsigned long ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat); +ULONG ComplexStructSize(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat); #endif /* __WINE_NDR_MISC_H */
14 years, 9 months
1
0
0
0
[cwittich] 46298: [WININET] sync wininet with wine 1.1.41
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Mar 21 15:53:28 2010 New Revision: 46298 URL:
http://svn.reactos.org/svn/reactos?rev=46298&view=rev
Log: [WININET] sync wininet with wine 1.1.41 Modified: trunk/reactos/dll/win32/wininet/http.c trunk/reactos/dll/win32/wininet/internet.c trunk/reactos/dll/win32/wininet/internet.h Modified: trunk/reactos/dll/win32/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
============================================================================== --- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Sun Mar 21 15:53:28 2010 @@ -1345,9 +1345,12 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *lpwhs, http_request_t *lpwhr) { WCHAR buf[MAXHOSTNAME]; + WCHAR protoProxy[MAXHOSTNAME + 15]; + DWORD protoProxyLen = sizeof(protoProxy) / sizeof(protoProxy[0]); WCHAR proxy[MAXHOSTNAME + 15]; /* 15 == "http://" + sizeof(port#) + ":/\0" */ static WCHAR szNul[] = { 0 }; URL_COMPONENTSW UrlComponents; + static const WCHAR protoHttp[] = { 'h','t','t','p',0 }; static const WCHAR szHttp[] = { 'h','t','t','p',':','/','/',0 }; static const WCHAR szFormat[] = { 'h','t','t','p',':','/','/','%','s',0 }; @@ -1356,11 +1359,13 @@ UrlComponents.lpszHostName = buf; UrlComponents.dwHostNameLength = MAXHOSTNAME; + if (!INTERNET_FindProxyForProtocol(hIC->lpszProxy, protoHttp, protoProxy, &protoProxyLen)) + return FALSE; if( CSTR_EQUAL != CompareStringW(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, - hIC->lpszProxy,strlenW(szHttp),szHttp,strlenW(szHttp)) ) - sprintfW(proxy, szFormat, hIC->lpszProxy); + protoProxy,strlenW(szHttp),szHttp,strlenW(szHttp)) ) + sprintfW(proxy, szFormat, protoProxy); else - strcpyW(proxy, hIC->lpszProxy); + strcpyW(proxy, protoProxy); if( !InternetCrackUrlW(proxy, 0, 0, &UrlComponents) ) return FALSE; if( UrlComponents.dwHostNameLength == 0 ) @@ -4253,8 +4258,6 @@ } if(hIC->lpszProxy && hIC->dwAccessType == INTERNET_OPEN_TYPE_PROXY) { - if(strchrW(hIC->lpszProxy, ' ')) - FIXME("Several proxies not implemented.\n"); if(hIC->lpszProxyBypass) FIXME("Proxy bypass is ignored.\n"); } Modified: trunk/reactos/dll/win32/wininet/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
============================================================================== --- trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] Sun Mar 21 15:53:28 2010 @@ -360,6 +360,98 @@ RegCloseKey(key); return ERROR_SUCCESS; +} + +/*********************************************************************** + * INTERNET_FindProxyForProtocol + * + * Searches the proxy string for a proxy of the given protocol. + * Returns the found proxy, or the default proxy if none of the given + * protocol is found. + * + * PARAMETERS + * szProxy [In] proxy string to search + * proto [In] protocol to search for, e.g. "http" + * foundProxy [Out] found proxy + * foundProxyLen [In/Out] length of foundProxy buffer, in WCHARs + * + * RETURNS + * TRUE if a proxy is found, FALSE if not. If foundProxy is too short, + * *foundProxyLen is set to the required size in WCHARs, including the + * NULL terminator, and the last error is set to ERROR_INSUFFICIENT_BUFFER. + */ +BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundProxy, DWORD *foundProxyLen) +{ + LPCWSTR ptr; + BOOL ret = FALSE; + + TRACE("(%s, %s)\n", debugstr_w(szProxy), debugstr_w(proto)); + + /* First, look for the specified protocol (proto=scheme://host:port) */ + for (ptr = szProxy; !ret && ptr && *ptr; ) + { + LPCWSTR end, equal; + + if (!(end = strchrW(ptr, ' '))) + end = ptr + strlenW(ptr); + if ((equal = strchrW(ptr, '=')) && equal < end && + equal - ptr == strlenW(proto) && + !strncmpiW(proto, ptr, strlenW(proto))) + { + if (end - equal > *foundProxyLen) + { + WARN("buffer too short for %s\n", + debugstr_wn(equal + 1, end - equal - 1)); + *foundProxyLen = end - equal; + SetLastError(ERROR_INSUFFICIENT_BUFFER); + } + else + { + memcpy(foundProxy, equal + 1, (end - equal) * sizeof(WCHAR)); + foundProxy[end - equal] = 0; + ret = TRUE; + } + } + if (*end == ' ') + ptr = end + 1; + else + ptr = end; + } + if (!ret) + { + /* It wasn't found: look for no protocol */ + for (ptr = szProxy; !ret && ptr && *ptr; ) + { + LPCWSTR end, equal; + + if (!(end = strchrW(ptr, ' '))) + end = ptr + strlenW(ptr); + if (!(equal = strchrW(ptr, '='))) + { + if (end - ptr + 1 > *foundProxyLen) + { + WARN("buffer too short for %s\n", + debugstr_wn(ptr, end - ptr)); + *foundProxyLen = end - ptr + 1; + SetLastError(ERROR_INSUFFICIENT_BUFFER); + } + else + { + memcpy(foundProxy, ptr, (end - ptr) * sizeof(WCHAR)); + foundProxy[end - ptr] = 0; + ret = TRUE; + } + } + if (*end == ' ') + ptr = end + 1; + else + ptr = end; + } + } + if (ret) + TRACE("found proxy for %s: %s\n", debugstr_w(proto), + debugstr_w(foundProxy)); + return ret; } /*********************************************************************** Modified: trunk/reactos/dll/win32/wininet/internet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
============================================================================== --- trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] Sun Mar 21 15:53:28 2010 @@ -422,6 +422,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwStatusInfoLength); +BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundProxy, DWORD *foundProxyLen); BOOL NETCON_connected(WININET_NETCONNECTION *connection); DWORD NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL);
14 years, 9 months
1
0
0
0
[ekohl] 46297: [NTOSKRNL] NtAccessCheck - Probe parameters. - Fail if generic access rights have not been mapped.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Mar 21 15:10:50 2010 New Revision: 46297 URL:
http://svn.reactos.org/svn/reactos?rev=46297&view=rev
Log: [NTOSKRNL] NtAccessCheck - Probe parameters. - Fail if generic access rights have not been mapped. Modified: trunk/reactos/ntoskrnl/se/semgr.c Modified: trunk/reactos/ntoskrnl/se/semgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/semgr.c?rev=46…
============================================================================== --- trunk/reactos/ntoskrnl/se/semgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/semgr.c [iso-8859-1] Sun Mar 21 15:10:50 2010 @@ -704,6 +704,27 @@ return STATUS_SUCCESS; } + /* Protect probe in SEH */ + _SEH2_TRY + { + /* Probe all pointers */ + ProbeForRead(GenericMapping, sizeof(GENERIC_MAPPING), sizeof(ULONG)); + ProbeForRead(PrivilegeSetLength, sizeof(ULONG), sizeof(ULONG)); + ProbeForWrite(PrivilegeSet, *PrivilegeSetLength, sizeof(ULONG)); + ProbeForWrite(GrantedAccess, sizeof(ACCESS_MASK), sizeof(ULONG)); + ProbeForWrite(AccessStatus, sizeof(NTSTATUS), sizeof(ULONG)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Return the exception code */ + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + + /* Check for unmapped access rights */ + if (DesiredAccess & (GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL)) + return STATUS_GENERIC_NOT_MAPPED; + /* Reference the token */ Status = ObReferenceObjectByHandle(TokenHandle, TOKEN_QUERY,
14 years, 9 months
1
0
0
0
[cwittich] 46296: [OLEAUT32] sync oleaut32 with wine 1.1.41
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Mar 21 14:04:42 2010 New Revision: 46296 URL:
http://svn.reactos.org/svn/reactos?rev=46296&view=rev
Log: [OLEAUT32] sync oleaut32 with wine 1.1.41 Modified: trunk/reactos/dll/win32/oleaut32/typelib.c trunk/reactos/dll/win32/oleaut32/typelib2.c Modified: trunk/reactos/dll/win32/oleaut32/typelib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] Sun Mar 21 14:04:42 2010 @@ -4722,6 +4722,7 @@ { ITypeLibImpl *This = impl_from_ITypeComp(iface); ITypeInfoImpl *pTypeInfo; + int typemismatch=0; TRACE("(%s, 0x%x, 0x%x, %p, %p, %p)\n", debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr); @@ -4761,6 +4762,8 @@ TRACE("found in module or in enum: %s\n", debugstr_w(szName)); return S_OK; } + else if (hr == TYPE_E_TYPEMISMATCH) + typemismatch = 1; } if ((pTypeInfo->TypeAttr.typekind == TKIND_COCLASS) && @@ -4833,11 +4836,21 @@ ITypeInfo_AddRef(*ppTInfo); return S_OK; } - } - } - - TRACE("name not found %s\n", debugstr_w(szName)); - return S_OK; + else if (hr == TYPE_E_TYPEMISMATCH) + typemismatch = 1; + } + } + + if (typemismatch) + { + TRACE("type mismatch %s\n", debugstr_w(szName)); + return TYPE_E_TYPEMISMATCH; + } + else + { + TRACE("name not found %s\n", debugstr_w(szName)); + return S_OK; + } } static HRESULT WINAPI ITypeLibComp_fnBindType( @@ -5568,6 +5581,11 @@ return S_OK; } *pImplTypeFlags=0; + + if(This->TypeAttr.typekind==TKIND_DISPATCH && !index) + return S_OK; + + WARN("ImplType %d not found\n", index); return TYPE_E_ELEMENTNOTFOUND; } @@ -6052,9 +6070,6 @@ hres = DISP_E_PARAMNOTFOUND; goto func_fail; } - /* ignore the DISPID_PROPERTYPUT named argument from now on */ - cNamedArgs--; - rgdispidNamedArgs++; } if (func_desc->cParamsOpt < 0 && cNamedArgs) @@ -6092,7 +6107,7 @@ USHORT j; src_arg = NULL; for (j = 0; j < cNamedArgs; j++) - if (rgdispidNamedArgs[j] == i) + if (rgdispidNamedArgs[j] == i || (i == func_desc->cParams-1 && rgdispidNamedArgs[j] == DISPID_PROPERTYPUT)) { src_arg = &pDispParams->rgvarg[j]; break; @@ -6859,7 +6874,8 @@ BSTR *pBstrMops) { ITypeInfoImpl *This = (ITypeInfoImpl *)iface; - FIXME("(%p) stub!\n", This); + FIXME("(%p %d) stub!\n", This, memid); + *pBstrMops = NULL; return S_OK; } Modified: trunk/reactos/dll/win32/oleaut32/typelib2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib2.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib2.c [iso-8859-1] Sun Mar 21 14:04:42 2010 @@ -199,9 +199,11 @@ struct tagCyclicList *typedata; /* tail of cyclic list */ + TYPEKIND typekind; int datawidth; struct tagICreateTypeInfo2Impl *next_typeinfo; + struct tagICreateTypeInfo2Impl *dual; } ICreateTypeInfo2Impl; static inline ICreateTypeInfo2Impl *impl_from_ITypeInfo2( ITypeInfo2 *iface ) @@ -1177,6 +1179,7 @@ { VARIANT v; HRESULT hres; + int mask = 0; TRACE("%p %d %d\n", This, V_VT(value), arg_type); @@ -1194,7 +1197,6 @@ /* Check if default value can be stored in encoded_value */ switch(arg_type) { - int mask = 0; case VT_I4: case VT_UI4: mask = 0x3ffffff; @@ -1313,7 +1315,7 @@ if(*ppvObject) { - ICreateTypeLib2_AddRef(iface); + ICreateTypeInfo2_AddRef(iface); TRACE("-- Interface: (%p)->(%p)\n",ppvObject,*ppvObject); return S_OK; } @@ -1332,6 +1334,9 @@ ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p)->ref was %u\n",This, ref - 1); + + if(ref==1 && This->typelib) + ICreateTypeLib2_AddRef((ICreateTypeLib2 *)This->typelib); return ref; } @@ -1406,43 +1411,63 @@ TRACE("(%p,0x%x)\n", iface, uTypeFlags); + if(uTypeFlags & TYPEFLAG_FDUAL) { + This->typeinfo->typekind |= 0x10; + This->typeinfo->typekind &= ~0x0f; + This->typeinfo->typekind |= TKIND_DISPATCH; + + if(!This->dual) { + This->dual = HeapAlloc(GetProcessHeap(), 0, sizeof(ICreateTypeInfo2Impl)); + if(!This->dual) + return E_OUTOFMEMORY; + + memcpy(This->dual, This, sizeof(ICreateTypeInfo2Impl)); + This->dual->ref = 0; + This->dual->typekind = This->typekind==TKIND_DISPATCH ? + TKIND_INTERFACE : TKIND_DISPATCH; + This->dual->dual = This; + } + + /* Make sure dispatch is in typeinfos queue */ + if(This->typekind != TKIND_DISPATCH) { + if(This->typelib->last_typeinfo == This) + This->typelib->last_typeinfo = This->dual; + + if(This->typelib->typeinfos == This) + This->typelib->typeinfos = This->dual; + else { + ICreateTypeInfo2Impl *iter; + + for(iter=This->typelib->typeinfos; iter->next_typeinfo!=This; iter=iter->next_typeinfo); + iter->next_typeinfo = This->dual; + } + } else + iface = (ICreateTypeInfo2*)&This->dual->lpVtbl; + } + + if (uTypeFlags & (TYPEFLAG_FDISPATCHABLE|TYPEFLAG_FDUAL)) { + static const WCHAR stdole2tlb[] = { 's','t','d','o','l','e','2','.','t','l','b',0 }; + ITypeLib *stdole; + ITypeInfo *dispatch; + HREFTYPE hreftype; + HRESULT hres; + + hres = LoadTypeLib(stdole2tlb, &stdole); + if(FAILED(hres)) + return hres; + + hres = ITypeLib_GetTypeInfoOfGuid(stdole, &IID_IDispatch, &dispatch); + ITypeLib_Release(stdole); + if(FAILED(hres)) + return hres; + + hres = ICreateTypeInfo2_AddRefTypeInfo(iface, dispatch, &hreftype); + ITypeInfo_Release(dispatch); + if(FAILED(hres)) + return hres; + } + This->typeinfo->flags = uTypeFlags; - - if (uTypeFlags & TYPEFLAG_FDISPATCHABLE) { - MSFT_GuidEntry foo; - int guidoffset; - int fileoffset; - MSFT_ImpInfo impinfo; - static const WCHAR stdole2tlb[] = { 's','t','d','o','l','e','2','.','t','l','b',0 }; - - foo.guid = IID_StdOle; - foo.hreftype = 2; - foo.next_hash = -1; - guidoffset = ctl2_alloc_guid(This->typelib, &foo); - if (guidoffset == -1) return E_OUTOFMEMORY; - - fileoffset = ctl2_alloc_importfile(This->typelib, guidoffset, - This->typelib->typelib_header.lcid2, 2, 0, stdole2tlb); - if (fileoffset == -1) return E_OUTOFMEMORY; - - foo.guid = IID_IDispatch; - foo.hreftype = 1; - foo.next_hash = -1; - guidoffset = ctl2_alloc_guid(This->typelib, &foo); - if (guidoffset == -1) return E_OUTOFMEMORY; - - impinfo.flags = TKIND_INTERFACE << 24 | MSFT_IMPINFO_OFFSET_IS_GUID; - impinfo.oImpFile = fileoffset; - impinfo.oGuid = guidoffset; - ctl2_alloc_importinfo(This->typelib, &impinfo); - - This->typelib->typelib_header.dispatchpos = 1; - - This->typeinfo->typekind |= 0x10; - This->typeinfo->typekind &= ~0x0f; - This->typeinfo->typekind |= TKIND_DISPATCH; - } - return S_OK; } @@ -1541,25 +1566,21 @@ /* Process locally defined TypeInfo */ *phRefType = This->typelib->typelib_typeinfo_offsets[index]; } else { - static const WCHAR regkey[] = {'T','y','p','e','L','i','b','\\','{', - '%','0','8','x','-','%','0','4','x','-','%','0','4','x','-','%', - '0','2','x','%','0','2','x','-','%','0','2','x','%','0','2','x', - '%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x', - '}','\\','%','d','.','%','d','\\','0','\\','w','i','n','3','2',0}; - - WCHAR name[MAX_PATH], *p; + BSTR name; TLIBATTR *tlibattr; TYPEATTR *typeattr; + TYPEKIND typekind; MSFT_GuidEntry guid, *check_guid; MSFT_ImpInfo impinfo; int guid_offset, import_offset; - DWORD len; HRESULT hres; /* Allocate container GUID */ hres = ITypeLib_GetLibAttr(container, &tlibattr); - if(FAILED(hres)) + if(FAILED(hres)) { + ITypeLib_Release(container); return hres; + } guid.guid = tlibattr->guid; guid.hreftype = This->typelib->typelib_guids*12+2; @@ -1568,6 +1589,7 @@ guid_offset = ctl2_alloc_guid(This->typelib, &guid); if(guid_offset == -1) { ITypeLib_ReleaseTLibAttr(container, tlibattr); + ITypeLib_Release(container); return E_OUTOFMEMORY; } @@ -1576,50 +1598,50 @@ This->typelib->typelib_guids++; /* Get import file name */ - /* Check HKEY_CLASSES_ROOT\TypeLib\{GUID}\{Ver}\0\win32 */ - len = MAX_PATH; - sprintfW(name, regkey, guid.guid.Data1, guid.guid.Data2, - guid.guid.Data3, guid.guid.Data4[0], guid.guid.Data4[1], - guid.guid.Data4[2], guid.guid.Data4[3], guid.guid.Data4[4], - guid.guid.Data4[5], guid.guid.Data4[6], guid.guid.Data4[7], - tlibattr->wMajorVerNum, tlibattr->wMinorVerNum); - - if(RegGetValueW(HKEY_CLASSES_ROOT, name, NULL, RRF_RT_REG_SZ, NULL, name, &len)!=ERROR_SUCCESS - || (p=strrchrW(name, '\\'))==NULL) { - ERR("Error guessing typelib filename\n"); + hres = QueryPathOfRegTypeLib(&guid.guid, tlibattr->wMajorVerNum, + tlibattr->wMinorVerNum, tlibattr->lcid, &name); + if(FAILED(hres)) { ITypeLib_ReleaseTLibAttr(container, tlibattr); - return E_NOTIMPL; + ITypeLib_Release(container); + return hres; } - memmove(name, p+1, strlenW(p)*sizeof(WCHAR)); /* Import file */ - import_offset = ctl2_alloc_importfile(This->typelib, guid_offset, - tlibattr->lcid, tlibattr->wMajorVerNum, tlibattr->wMinorVerNum, name); + import_offset = ctl2_alloc_importfile(This->typelib, guid_offset, tlibattr->lcid, + tlibattr->wMajorVerNum, tlibattr->wMinorVerNum, strrchrW(name, '\\')+1); ITypeLib_ReleaseTLibAttr(container, tlibattr); - - if(import_offset == -1) + SysFreeString(name); + + if(import_offset == -1) { + ITypeLib_Release(container); return E_OUTOFMEMORY; + } /* Allocate referenced guid */ hres = ITypeInfo_GetTypeAttr(pTInfo, &typeattr); - if(FAILED(hres)) + if(FAILED(hres)) { + ITypeLib_Release(container); return hres; + } guid.guid = typeattr->guid; guid.hreftype = This->typelib->typeinfo_guids*12+1; guid.next_hash = -1; + typekind = typeattr->typekind; ITypeInfo_ReleaseTypeAttr(pTInfo, typeattr); guid_offset = ctl2_alloc_guid(This->typelib, &guid); - if(guid_offset == -1) + if(guid_offset == -1) { + ITypeLib_Release(container); return E_OUTOFMEMORY; + } check_guid = (MSFT_GuidEntry*)&This->typelib->typelib_segment_data[MSFT_SEG_GUID][guid_offset]; if(check_guid->hreftype == guid.hreftype) This->typelib->typeinfo_guids++; /* Allocate importinfo */ - impinfo.flags = ((This->typeinfo->typekind&0xf)<<24) | MSFT_IMPINFO_OFFSET_IS_GUID; + impinfo.flags = (typekind<<24) | MSFT_IMPINFO_OFFSET_IS_GUID; impinfo.oImpFile = import_offset; impinfo.oGuid = guid_offset; *phRefType = ctl2_alloc_importinfo(This->typelib, &impinfo)+1; @@ -1652,7 +1674,7 @@ TRACE("(%p,%d,%p)\n", iface, index, pFuncDesc); - if(!pFuncDesc || (pFuncDesc->memid>0x7fffffff && pFuncDesc->memid!=MEMBERID_NIL)) + if(!pFuncDesc || pFuncDesc->oVft&3) return E_INVALIDARG; TRACE("{%d,%p,%p,%d,%d,%d,%d,%d,%d,%d,{%d},%d}\n", pFuncDesc->memid, @@ -1661,7 +1683,10 @@ pFuncDesc->cParamsOpt, pFuncDesc->oVft, pFuncDesc->cScodes, pFuncDesc->elemdescFunc.tdesc.vt, pFuncDesc->wFuncFlags); - switch(This->typeinfo->typekind&0xf) { + if(pFuncDesc->cParamsOpt || pFuncDesc->cScodes) + FIXME("Unimplemented parameter - created typelib will be incorrect\n"); + + switch(This->typekind) { case TKIND_MODULE: if(pFuncDesc->funckind != FUNC_STATIC) return TYPE_E_BADMODULEKIND; @@ -1688,12 +1713,15 @@ num_defaults++; if (!This->typedata) { - This->typedata = HeapAlloc(GetProcessHeap(), 0, sizeof(CyclicList)); + This->typedata = HeapAlloc(GetProcessHeap(), 0, sizeof(CyclicList)); if(!This->typedata) return E_OUTOFMEMORY; This->typedata->next = This->typedata; - This->typedata->u.val = 0; + This->typedata->u.val = 0; + + if(This->dual) + This->dual->typedata = This->typedata; } /* allocate type data space for us */ @@ -1711,7 +1739,7 @@ typedata[0] = 0x18 + pFuncDesc->cParams*(num_defaults?16:12); ctl2_encode_typedesc(This->typelib, &pFuncDesc->elemdescFunc.tdesc, &typedata[1], NULL, NULL, &decoded_size); typedata[2] = pFuncDesc->wFuncFlags; - typedata[3] = ((sizeof(FUNCDESC) + decoded_size) << 16) | This->typeinfo->cbSizeVft; + typedata[3] = ((sizeof(FUNCDESC) + decoded_size) << 16) | (unsigned short)(pFuncDesc->oVft?pFuncDesc->oVft+1:0); typedata[4] = (pFuncDesc->callconv << 8) | (pFuncDesc->invkind << 3) | pFuncDesc->funckind; if(num_defaults) typedata[4] |= 0x1000; typedata[5] = pFuncDesc->cParams; @@ -1758,6 +1786,9 @@ insert->next = This->typedata->next; This->typedata->next = insert; This->typedata = insert; + + if(This->dual) + This->dual->typedata = This->typedata; } else { iter = This->typedata->next; for(i=0; i<index; i++) @@ -1790,7 +1821,7 @@ TRACE("(%p,%d,%d)\n", iface, index, hRefType); - if ((This->typeinfo->typekind & 15) == TKIND_COCLASS) { + if (This->typekind == TKIND_COCLASS) { int offset; MSFT_RefRecord *ref; @@ -1822,21 +1853,26 @@ ref->flags = 0; ref->oCustData = -1; ref->onext = -1; - } else if ((This->typeinfo->typekind & 15) == TKIND_DISPATCH) { - FIXME("dispatch case unhandled.\n"); - } else if ((This->typeinfo->typekind & 15) == TKIND_INTERFACE) { + This->typeinfo->cImplTypes++; + } else if (This->typekind == TKIND_INTERFACE) { if (This->typeinfo->cImplTypes && index==1) return TYPE_E_BADMODULEKIND; if( index != 0) return TYPE_E_ELEMENTNOTFOUND; This->typeinfo->datatype1 = hRefType; + This->typeinfo->cImplTypes = 1; + } else if (This->typekind == TKIND_DISPATCH) { + if(index != 0) return TYPE_E_ELEMENTNOTFOUND; + + /* FIXME: Check if referenced typeinfo is IDispatch */ + This->typeinfo->flags |= TYPEFLAG_FDISPATCHABLE; + This->typeinfo->cImplTypes = 1; } else { - FIXME("AddImplType unsupported on typekind %d\n", This->typeinfo->typekind & 15); + FIXME("AddImplType unsupported on typekind %d\n", This->typekind); return E_OUTOFMEMORY; } - This->typeinfo->cImplTypes++; return S_OK; } @@ -1856,7 +1892,7 @@ TRACE("(%p,%d,0x%x)\n", iface, index, implTypeFlags); - if ((This->typeinfo->typekind & 15) != TKIND_COCLASS) { + if (This->typekind != TKIND_COCLASS) { return TYPE_E_BADMODULEKIND; } @@ -1889,7 +1925,7 @@ This->typeinfo->typekind |= cbAlignment << 6; /* FIXME: There's probably some way to simplify this. */ - switch (This->typeinfo->typekind & 15) { + switch (This->typekind) { case TKIND_ALIAS: default: break; @@ -1963,6 +1999,9 @@ This->typedata->next = This->typedata; This->typedata->u.val = 0; + + if(This->dual) + This->dual->typedata = This->typedata; } /* allocate type data space for us */ @@ -1979,6 +2018,9 @@ This->typedata->next = insert; This->typedata = insert; + if(This->dual) + This->dual->typedata = This->typedata; + This->typedata->next->u.val += 0x14; typedata = This->typedata->u.data; @@ -2003,6 +2045,8 @@ /* add the new variable to the total data width */ This->datawidth += var_datawidth; + if(This->dual) + This->dual->datawidth = This->datawidth; /* add type description size to total required allocation */ typedata[3] += var_type_size << 16; @@ -2125,7 +2169,7 @@ *((INT *)namedata) = This->typelib->typelib_typeinfo_offsets[This->typeinfo->typekind >> 16]; namedata[9] |= 0x10; } - if ((This->typeinfo->typekind & 15) == TKIND_ENUM) { + if (This->typekind == TKIND_ENUM) { namedata[9] |= 0x20; } @@ -2151,7 +2195,7 @@ int encoded_typedesc; int width; - if ((This->typeinfo->typekind & 15) != TKIND_ALIAS) { + if (This->typekind != TKIND_ALIAS) { return TYPE_E_WRONGTYPEKIND; } @@ -2225,8 +2269,42 @@ UINT index, DWORD dwHelpContext) { - FIXME("(%p,%d,%d), stub!\n", iface, index, dwHelpContext); - return E_OUTOFMEMORY; + ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface; + CyclicList *func; + int *typedata; + int size; + + TRACE("(%p,%d,%d)\n", iface, index, dwHelpContext); + + if(This->typeinfo->cElement<index) + return TYPE_E_ELEMENTNOTFOUND; + + if(This->typeinfo->cElement == index) + func = This->typedata; + else + for(func=This->typedata->next->next; func!=This->typedata; func=func->next) + if(index-- == 0) + break; + + typedata = func->u.data; + + /* Compute func size without arguments */ + size = typedata[0] - typedata[5]*(typedata[4]&0x1000?16:12); + + /* Allocate memory for HelpContext if needed */ + if(size < 7*sizeof(int)) { + typedata = HeapReAlloc(GetProcessHeap(), 0, typedata, typedata[0]+sizeof(int)); + if(!typedata) + return E_OUTOFMEMORY; + + memmove(&typedata[7], &typedata[6], typedata[0]-sizeof(int)*6); + typedata[0] += sizeof(int); + This->typedata->next->u.val += sizeof(int); + func->u.data = typedata; + } + + typedata[6] = dwHelpContext; + return S_OK; } /****************************************************************************** @@ -2282,11 +2360,13 @@ CyclicList *iter, *iter2, **typedata; HREFTYPE hreftype; HRESULT hres; + unsigned user_vft = 0; int i; TRACE("(%p)\n", iface); - if((This->typeinfo->typekind&0xf) == TKIND_COCLASS) + /* FIXME: LayOut should be run on all ImplTypes */ + if(This->typekind == TKIND_COCLASS) return S_OK; /* Validate inheritance */ @@ -2317,15 +2397,17 @@ return hres; hres = ITypeInfo_GetRefTypeInfo(next, hreftype, &cur); + ITypeInfo_Release(next); if(FAILED(hres)) return hres; - ITypeInfo_Release(next); while(1) { hres = ITypeInfo_GetTypeAttr(cur, &typeattr); - if(FAILED(hres)) + if(FAILED(hres)) { + ITypeInfo_Release(cur); return hres; + } if(!memcmp(&typeattr->guid, &IID_IDispatch, sizeof(IDispatch))) This->typeinfo->flags |= TYPEFLAG_FDISPATCHABLE; @@ -2336,19 +2418,51 @@ hres = ITypeInfo_GetRefTypeOfImplType(cur, 0, &hreftype); if(hres == TYPE_E_ELEMENTNOTFOUND) break; - if(FAILED(hres)) + if(FAILED(hres)) { + ITypeInfo_Release(cur); return hres; + } hres = ITypeInfo_GetRefTypeInfo(cur, hreftype, &next); - if(FAILED(hres)) + if(FAILED(hres)) { + ITypeInfo_Release(cur); return hres; + } ITypeInfo_Release(cur); cur = next; } - } - - This->typeinfo->cbSizeVft = (This->typeinfo->datatype2>>16) * 4; + ITypeInfo_Release(cur); + } + + /* Get cbSizeVft of inherited interface */ + /* Makes LayOut running recursively */ + if(This->typeinfo->datatype1 != -1) { + ITypeInfo *cur, *inherited; + TYPEATTR *typeattr; + + hres = ICreateTypeInfo_QueryInterface(iface, &IID_ITypeInfo, (void**)&cur); + if(FAILED(hres)) + return hres; + + hres = ITypeInfo_GetRefTypeInfo(cur, This->typeinfo->datatype1, &inherited); + ITypeInfo_Release(cur); + if(FAILED(hres)) + return hres; + + hres = ITypeInfo_GetTypeAttr(inherited, &typeattr); + if(FAILED(hres)) { + ITypeInfo_Release(inherited); + return hres; + } + + This->typeinfo->cbSizeVft = typeattr->cbSizeVft; + + ITypeInfo_ReleaseTypeAttr(inherited, typeattr); + ITypeInfo_Release(inherited); + } else + This->typeinfo->cbSizeVft = 0; + if(!This->typedata) return S_OK; @@ -2358,6 +2472,9 @@ /* Assign IDs and VTBL entries */ i = 0; + if(This->typedata->u.data[3]&1) + user_vft = This->typedata->u.data[3]&0xffff; + for(iter=This->typedata->next->next; iter!=This->typedata->next; iter=iter->next) { /* Assign MEMBERID if MEMBERID_NIL was specified */ if(iter->indice == MEMBERID_NIL) { @@ -2370,8 +2487,10 @@ for(iter2=This->typedata->next->next; iter2!=This->typedata->next; iter2=iter2->next) { if(iter == iter2) continue; - if(iter2->indice == iter->indice) + if(iter2->indice == iter->indice) { + HeapFree(GetProcessHeap(), 0, typedata); return E_ACCESSDENIED; + } } break; @@ -2383,7 +2502,20 @@ iter->u.data[0] = (iter->u.data[0]&0xffff) | (i<<16); - if((This->typeinfo->typekind&0xf) != TKIND_MODULE) { + if((iter->u.data[3]&1) != (user_vft&1)) { + HeapFree(GetProcessHeap(), 0, typedata); + return TYPE_E_INVALIDID; + } + + if(user_vft&1) { + if(user_vft < (iter->u.data[3]&0xffff)) + user_vft = (iter->u.data[3]&0xffff); + + if((iter->u.data[3]&0xffff) < This->typeinfo->cbSizeVft) { + HeapFree(GetProcessHeap(), 0, typedata); + return TYPE_E_INVALIDID; + } + } else if(This->typekind != TKIND_MODULE) { iter->u.data[3] = (iter->u.data[3]&0xffff0000) | This->typeinfo->cbSizeVft; This->typeinfo->cbSizeVft += 4; } @@ -2405,6 +2537,9 @@ i++; } + + if(user_vft) + This->typeinfo->cbSizeVft = user_vft+3; for(i=0; i<(This->typeinfo->cElement&0xffff); i++) { if(typedata[i]->u.data[4]>>16 > i) { @@ -2787,11 +2922,13 @@ (*ppTypeAttr)->lcid = This->typelib->typelib_header.lcid; (*ppTypeAttr)->cbSizeInstance = This->typeinfo->size; - (*ppTypeAttr)->typekind = This->typeinfo->typekind&0xf; + (*ppTypeAttr)->typekind = This->typekind; (*ppTypeAttr)->cFuncs = This->typeinfo->cElement&0xffff; + if(This->typeinfo->flags&TYPEFLAG_FDUAL && This->typekind==TKIND_DISPATCH) + (*ppTypeAttr)->cFuncs += 7; (*ppTypeAttr)->cVars = This->typeinfo->cElement>>16; (*ppTypeAttr)->cImplTypes = This->typeinfo->cImplTypes; - (*ppTypeAttr)->cbSizeVft = This->typeinfo->cbSizeVft; + (*ppTypeAttr)->cbSizeVft = This->typekind==TKIND_DISPATCH ? 28 : This->typeinfo->cbSizeVft; (*ppTypeAttr)->cbAlignment = (This->typeinfo->typekind>>11) & 0x1f; (*ppTypeAttr)->wTypeFlags = This->typeinfo->flags; (*ppTypeAttr)->wMajorVerNum = This->typeinfo->version&0xffff; @@ -2879,15 +3016,21 @@ if(!pRefType) return E_INVALIDARG; - if(index == -1) { - FIXME("Dual interfaces not handled yet\n"); - return E_NOTIMPL; - } - - if(index >= This->typeinfo->cImplTypes) + if(This->typeinfo->flags&TYPEFLAG_FDUAL) { + if(index == -1) { + *pRefType = -2; + return S_OK; + } + + if(This->typekind == TKIND_DISPATCH) + return ITypeInfo2_GetRefTypeOfImplType((ITypeInfo2*)&This->dual->lpVtblTypeInfo2, + index, pRefType); + } + + if(index>=This->typeinfo->cImplTypes) return TYPE_E_ELEMENTNOTFOUND; - if((This->typeinfo->typekind&0xf) == TKIND_INTERFACE) { + if(This->typekind == TKIND_INTERFACE) { *pRefType = This->typeinfo->datatype1 + 2; return S_OK; } @@ -2923,7 +3066,7 @@ if(index >= This->typeinfo->cImplTypes) return TYPE_E_ELEMENTNOTFOUND; - if((This->typeinfo->typekind&0xf) != TKIND_COCLASS) { + if(This->typekind != TKIND_COCLASS) { *pImplTypeFlags = 0; return S_OK; } @@ -3022,6 +3165,12 @@ if(!ppTInfo) return E_INVALIDARG; + if(hRefType==-2 && This->dual) { + *ppTInfo = (ITypeInfo*)&This->dual->lpVtblTypeInfo2; + ITypeInfo_AddRef(*ppTInfo); + return S_OK; + } + if(hRefType&1) { ITypeLib *tl; MSFT_ImpInfo *impinfo; @@ -3124,7 +3273,7 @@ TRACE("(%p,%p,%p)\n", iface, ppTLib, pIndex); *ppTLib = (ITypeLib *)&This->typelib->lpVtblTypeLib2; - This->typelib->ref++; + ICreateTypeLib_AddRef((ICreateTypeLib*)This->typelib); *pIndex = This->typeinfo->typekind >> 16; return S_OK; @@ -3573,7 +3722,7 @@ pCreateTypeInfo2Impl->ref = 1; pCreateTypeInfo2Impl->typelib = typelib; - typelib->ref++; + ICreateTypeLib_AddRef((ICreateTypeLib*)typelib); nameoffset = ctl2_alloc_name(typelib, szName); typeinfo_offset = ctl2_alloc_typeinfo(typelib, nameoffset); @@ -3584,6 +3733,7 @@ pCreateTypeInfo2Impl->typeinfo = typeinfo; + pCreateTypeInfo2Impl->typekind = tkind; typeinfo->typekind |= tkind | 0x20; ICreateTypeInfo2_SetAlignment((ICreateTypeInfo2 *)pCreateTypeInfo2Impl, 4); @@ -3717,7 +3867,9 @@ HeapFree(GetProcessHeap(), 0, rem); } } - HeapFree(GetProcessHeap(), 0, typeinfo); + + HeapFree(GetProcessHeap(), 0, typeinfo->dual); + HeapFree(GetProcessHeap(), 0, typeinfo); } HeapFree(GetProcessHeap(),0,This);
14 years, 9 months
1
0
0
0
[cwittich] 46295: [OLE32] sync ole32 with wine 1.1.41
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Mar 21 14:00:22 2010 New Revision: 46295 URL:
http://svn.reactos.org/svn/reactos?rev=46295&view=rev
Log: [OLE32] sync ole32 with wine 1.1.41 Removed: trunk/reactos/dll/win32/ole32/ifs.h trunk/reactos/dll/win32/ole32/ole16.c Modified: trunk/reactos/dll/win32/ole32/compobj.c trunk/reactos/dll/win32/ole32/stg_bigblockfile.c trunk/reactos/dll/win32/ole32/stg_prop.c trunk/reactos/dll/win32/ole32/storage32.c trunk/reactos/dll/win32/ole32/storage32.h Modified: trunk/reactos/dll/win32/ole32/compobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/compobj.c?…
============================================================================== --- trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/compobj.c [iso-8859-1] Sun Mar 21 14:00:22 2010 @@ -2956,7 +2956,7 @@ HRESULT res = S_OK; LONG len = sizeof(szClsidNew); - FIXME("(%s,%p)\n", debugstr_guid(clsidOld), clsidNew); + TRACE("(%s,%p)\n", debugstr_guid(clsidOld), clsidNew); *clsidNew = *clsidOld; /* copy over old value */ res = COM_OpenKeyForCLSID(clsidOld, wszTreatAs, KEY_READ, &hkey); Removed: trunk/reactos/dll/win32/ole32/ifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ifs.h?rev=…
============================================================================== --- trunk/reactos/dll/win32/ole32/ifs.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ifs.h (removed) @@ -1,156 +1,0 @@ -/* - * Copyright 1997 Marcus Meissner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_OLE_IFS_H -#define __WINE_OLE_IFS_H - -#include <stdarg.h> - -#include "windef.h" -#include "winbase.h" -#include "objbase.h" - -typedef CHAR OLECHAR16; -typedef LPSTR LPOLESTR16; -typedef LPCSTR LPCOLESTR16; - -#define STDMETHOD16CALLTYPE __cdecl -#define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m) -#define STDMETHOD16_(t,m) t (STDMETHOD16CALLTYPE *m) - - -/*********************************************************************** - * IMalloc16 interface - */ - -typedef struct IMalloc16 *LPMALLOC16; - -#define INTERFACE IMalloc16 -DECLARE_INTERFACE_(IMalloc16,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD16_(ULONG,AddRef)(THIS) PURE; - STDMETHOD16_(ULONG,Release)(THIS) PURE; - /*** IMalloc16 methods ***/ - STDMETHOD16_(LPVOID,Alloc)(THIS_ DWORD cb) PURE; - STDMETHOD16_(LPVOID,Realloc)(THIS_ LPVOID pv, DWORD cb) PURE; - STDMETHOD16_(void,Free)(THIS_ LPVOID pv) PURE; - STDMETHOD16_(DWORD,GetSize)(THIS_ LPVOID pv) PURE; - STDMETHOD16_(INT16,DidAlloc)(THIS_ LPVOID pv) PURE; - STDMETHOD16_(LPVOID,HeapMinimize)(THIS) PURE; -}; -#undef INTERFACE - -/**********************************************************************/ - -typedef struct ILockBytes16 *LPLOCKBYTES16; - -#define INTERFACE ILockBytes16 -DECLARE_INTERFACE_(ILockBytes16,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD16_(ULONG,AddRef)(THIS) PURE; - STDMETHOD16_(ULONG,Release)(THIS) PURE; - /*** ILockBytes16 methods ***/ - STDMETHOD16(ReadAt)(THIS_ ULARGE_INTEGER ulOffset, void *pv, ULONG cb, ULONG *pcbRead) PURE; - STDMETHOD16(WriteAt)(THIS_ ULARGE_INTEGER ulOffset, const void *pv, ULONG cb, ULONG *pcbWritten) PURE; - STDMETHOD16(Flush)(THIS) PURE; - STDMETHOD16(SetSize)(THIS_ ULARGE_INTEGER cb) PURE; - STDMETHOD16(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE; - STDMETHOD16(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE; - STDMETHOD16(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag) PURE; -}; -#undef INTERFACE - -/**********************************************************************/ - -typedef struct tagSTATSTG16 -{ - LPOLESTR16 pwcsName; - DWORD type; - ULARGE_INTEGER cbSize; - FILETIME mtime; - FILETIME ctime; - FILETIME atime; - DWORD grfMode; - DWORD grfLocksSupported; - CLSID clsid; - DWORD grfStateBits; - DWORD reserved; -} STATSTG16; - -typedef struct IStream16 *LPSTREAM16; - -#define INTERFACE IStream16 -DECLARE_INTERFACE_(IStream16,ISequentialStream) -{ - /*** IUnknown methods ***/ - STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD16_(ULONG,AddRef)(THIS) PURE; - STDMETHOD16_(ULONG,Release)(THIS) PURE; - /*** ISequentialStream methods ***/ - STDMETHOD16_(HRESULT,Read)(THIS_ void* pv, ULONG cb, ULONG* pcbRead) PURE; - STDMETHOD16_(HRESULT,Write)(THIS_ const void* pv, ULONG cb, ULONG* pcbWritten) PURE; - /*** IStream16 methods ***/ - STDMETHOD16(Seek)(THIS_ LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) PURE; - STDMETHOD16(SetSize)(THIS_ ULARGE_INTEGER libNewSize) PURE; - STDMETHOD16(CopyTo)(THIS_ IStream16* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) PURE; - STDMETHOD16(Commit)(THIS_ DWORD grfCommitFlags) PURE; - STDMETHOD16(Revert)(THIS) PURE; - STDMETHOD16(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE; - STDMETHOD16(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE; - STDMETHOD16(Stat)(THIS_ STATSTG* pstatstg, DWORD grfStatFlag) PURE; - STDMETHOD16(Clone)(THIS_ IStream16** ppstm) PURE; -}; -#undef INTERFACE - -/**********************************************************************/ - -typedef OLECHAR16 **SNB16; - -typedef struct IStorage16 *LPSTORAGE16; - -#define INTERFACE IStorage16 -DECLARE_INTERFACE_(IStorage16,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD16_(ULONG,AddRef)(THIS) PURE; - STDMETHOD16_(ULONG,Release)(THIS) PURE; - /*** IStorage16 methods ***/ - STDMETHOD16_(HRESULT,CreateStream)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream16** ppstm) PURE; - STDMETHOD16_(HRESULT,OpenStream)(THIS_ LPCOLESTR16 pwcsName, void* reserved1, DWORD grfMode, DWORD reserved2, IStream16** ppstm) PURE; - STDMETHOD16_(HRESULT,CreateStorage)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage16** ppstg) PURE; - STDMETHOD16_(HRESULT,OpenStorage)(THIS_ LPCOLESTR16 pwcsName, IStorage16* pstgPriority, DWORD grfMode, SNB16 snbExclude, DWORD reserved, IStorage16** ppstg) PURE; - STDMETHOD16_(HRESULT,CopyTo)(THIS_ DWORD ciidExclude, const IID* rgiidExclude, SNB16 snbExclude, IStorage16* pstgDest) PURE; - STDMETHOD16_(HRESULT,MoveElementTo)(THIS_ LPCOLESTR16 pwcsName, IStorage16* pstgDest, LPCOLESTR16 pwcsNewName, DWORD grfFlags) PURE; - STDMETHOD16_(HRESULT,Commit)(THIS_ DWORD grfCommitFlags) PURE; - STDMETHOD16_(HRESULT,Revert)(THIS) PURE; - STDMETHOD16_(HRESULT,EnumElements)(THIS_ DWORD reserved1, void* reserved2, DWORD reserved3, IEnumSTATSTG** ppenum) PURE; - STDMETHOD16_(HRESULT,DestroyElement)(THIS_ LPCOLESTR16 pwcsName) PURE; - STDMETHOD16_(HRESULT,RenameElement)(THIS_ LPCOLESTR16 pwcsOldName, LPCOLESTR16 pwcsNewName) PURE; - STDMETHOD16_(HRESULT,SetElementTimes)(THIS_ LPCOLESTR16 pwcsName, const FILETIME* pctime, const FILETIME* patime, const FILETIME* pmtime) PURE; - STDMETHOD16_(HRESULT,SetClass)(THIS_ REFCLSID clsid) PURE; - STDMETHOD16_(HRESULT,SetStateBits)(THIS_ DWORD grfStateBits, DWORD grfMask) PURE; - STDMETHOD16_(HRESULT,Stat)(THIS_ STATSTG* pstatstg, DWORD grfStatFlag) PURE; -}; -#undef INTERFACE - -#endif /* __WINE_OLE_IFS_H */ Removed: trunk/reactos/dll/win32/ole32/ole16.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ole16.c?re…
============================================================================== --- trunk/reactos/dll/win32/ole32/ole16.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ole16.c (removed) @@ -1,675 +1,0 @@ -/* - * 16 bit ole functions - * - * Copyright 1995 Martin von Loewis - * Copyright 1998 Justin Bradford - * Copyright 1999 Francis Beaudet - * Copyright 1999 Sylvain St-Germain - * Copyright 2002 Marcus Meissner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "config.h" - -#include <stdlib.h> -#include <stdarg.h> -#include <stdio.h> -#include <string.h> -#include <assert.h> - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "objbase.h" -#include "ole2.h" -#include "rpc.h" -#include "winerror.h" -#include "winreg.h" -#include "wownt32.h" -#include "wtypes.h" -#include "wine/unicode.h" -#include "wine/winbase16.h" -#include "compobj_private.h" -#include "ifs.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(ole); - -static HTASK16 hETask = 0; -static WORD Table_ETask[62]; - -static LPMALLOC16 currentMalloc16=NULL; - -/* --- IMalloc16 implementation */ - - -typedef struct -{ - /* IUnknown fields */ - const IMalloc16Vtbl *lpVtbl; - DWORD ref; - /* IMalloc16 fields */ -} IMalloc16Impl; - -/****************************************************************************** - * IMalloc16_QueryInterface [COMPOBJ.500] - */ -HRESULT CDECL IMalloc16_fnQueryInterface(IMalloc16* iface,REFIID refiid,LPVOID *obj) { - IMalloc16Impl *This = (IMalloc16Impl *)iface; - - TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(refiid),obj); - if ( !memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown)) || - !memcmp(&IID_IMalloc,refiid,sizeof(IID_IMalloc)) - ) { - *obj = This; - return 0; - } - return OLE_E_ENUM_NOMORE; -} - -/****************************************************************************** - * IMalloc16_AddRef [COMPOBJ.501] - */ -ULONG CDECL IMalloc16_fnAddRef(IMalloc16* iface) { - IMalloc16Impl *This = (IMalloc16Impl *)iface; - TRACE("(%p)->AddRef()\n",This); - return 1; /* cannot be freed */ -} - -/****************************************************************************** - * IMalloc16_Release [COMPOBJ.502] - */ -ULONG CDECL IMalloc16_fnRelease(IMalloc16* iface) { - IMalloc16Impl *This = (IMalloc16Impl *)iface; - TRACE("(%p)->Release()\n",This); - return 1; /* cannot be freed */ -} - -/****************************************************************************** - * IMalloc16_Alloc [COMPOBJ.503] - */ -SEGPTR CDECL IMalloc16_fnAlloc(IMalloc16* iface,DWORD cb) { - IMalloc16Impl *This = (IMalloc16Impl *)iface; - TRACE("(%p)->Alloc(%d)\n",This,cb); - return MapLS( HeapAlloc( GetProcessHeap(), 0, cb ) ); -} - -/****************************************************************************** - * IMalloc16_Free [COMPOBJ.505] - */ -VOID CDECL IMalloc16_fnFree(IMalloc16* iface,SEGPTR pv) -{ - void *ptr = MapSL(pv); - IMalloc16Impl *This = (IMalloc16Impl *)iface; - TRACE("(%p)->Free(%08x)\n",This,pv); - UnMapLS(pv); - HeapFree( GetProcessHeap(), 0, ptr ); -} - -/****************************************************************************** - * IMalloc16_Realloc [COMPOBJ.504] - */ -SEGPTR CDECL IMalloc16_fnRealloc(IMalloc16* iface,SEGPTR pv,DWORD cb) -{ - SEGPTR ret; - IMalloc16Impl *This = (IMalloc16Impl *)iface; - TRACE("(%p)->Realloc(%08x,%d)\n",This,pv,cb); - if (!pv) - ret = IMalloc16_fnAlloc(iface, cb); - else if (cb) { - ret = MapLS( HeapReAlloc( GetProcessHeap(), 0, MapSL(pv), cb ) ); - UnMapLS(pv); - } else { - IMalloc16_fnFree(iface, pv); - ret = 0; - } - return ret; -} - -/****************************************************************************** - * IMalloc16_GetSize [COMPOBJ.506] - */ -DWORD CDECL IMalloc16_fnGetSize(IMalloc16* iface,SEGPTR pv) -{ - IMalloc16Impl *This = (IMalloc16Impl *)iface; - TRACE("(%p)->GetSize(%08x)\n",This,pv); - return HeapSize( GetProcessHeap(), 0, MapSL(pv) ); -} - -/****************************************************************************** - * IMalloc16_DidAlloc [COMPOBJ.507] - */ -INT16 CDECL IMalloc16_fnDidAlloc(IMalloc16* iface,LPVOID pv) { - IMalloc16 *This = iface; - TRACE("(%p)->DidAlloc(%p)\n",This,pv); - return (INT16)-1; -} - -/****************************************************************************** - * IMalloc16_HeapMinimize [COMPOBJ.508] - */ -LPVOID CDECL IMalloc16_fnHeapMinimize(IMalloc16* iface) { - IMalloc16Impl *This = (IMalloc16Impl *)iface; - TRACE("(%p)->HeapMinimize()\n",This); - return NULL; -} - -/****************************************************************************** - * IMalloc16_Constructor [VTABLE] - */ -static LPMALLOC16 -IMalloc16_Constructor(void) -{ - static IMalloc16Vtbl vt16; - static SEGPTR msegvt16; - IMalloc16Impl* This; - HMODULE16 hcomp = GetModuleHandle16("COMPOBJ"); - - This = HeapAlloc( GetProcessHeap(), 0, sizeof(IMalloc16Impl) ); - if (!msegvt16) - { -#define VTENT(x) vt16.x = (void*)GetProcAddress16(hcomp,"IMalloc16_"#x);assert(vt16.x) - VTENT(QueryInterface); - VTENT(AddRef); - VTENT(Release); - VTENT(Alloc); - VTENT(Realloc); - VTENT(Free); - VTENT(GetSize); - VTENT(DidAlloc); - VTENT(HeapMinimize); -#undef VTENT - msegvt16 = MapLS( &vt16 ); - } - This->lpVtbl = (const IMalloc16Vtbl*)msegvt16; - This->ref = 1; - return (LPMALLOC16)MapLS( This ); -} - - -/*********************************************************************** - * CoGetMalloc [COMPOBJ.4] - * - * Retrieve the current win16 IMalloc interface. - * - * RETURNS - * The current win16 IMalloc - */ -HRESULT WINAPI CoGetMalloc16( - DWORD dwMemContext, /* [in] unknown */ - LPMALLOC16 * lpMalloc /* [out] current win16 malloc interface */ -) { - if(!currentMalloc16) - currentMalloc16 = IMalloc16_Constructor(); - *lpMalloc = currentMalloc16; - return S_OK; -} - -/*********************************************************************** - * CoCreateStandardMalloc [COMPOBJ.71] - */ -HRESULT WINAPI CoCreateStandardMalloc16(DWORD dwMemContext, - LPMALLOC16 *lpMalloc) -{ - /* FIXME: docu says we shouldn't return the same allocator as in - * CoGetMalloc16 */ - *lpMalloc = IMalloc16_Constructor(); - return S_OK; -} - -/****************************************************************************** - * CoInitialize [COMPOBJ.2] - * Set the win16 IMalloc used for memory management - */ -HRESULT WINAPI CoInitialize16( - LPVOID lpReserved /* [in] pointer to win16 malloc interface */ -) { - currentMalloc16 = (LPMALLOC16)lpReserved; - return S_OK; -} - -/*********************************************************************** - * CoUninitialize [COMPOBJ.3] - * Don't know what it does. - * 3-Nov-98 -- this was originally misspelled, I changed it to what I - * believe is the correct spelling - */ -void WINAPI CoUninitialize16(void) -{ - TRACE("()\n"); - CoFreeAllLibraries(); -} - -/*********************************************************************** - * IsEqualGUID [COMPOBJ.18] - * - * Compares two Unique Identifiers. - * - * RETURNS - * TRUE if equal - */ -BOOL16 WINAPI IsEqualGUID16( - GUID* g1, /* [in] unique id 1 */ - GUID* g2) /* [in] unique id 2 */ -{ - return !memcmp( g1, g2, sizeof(GUID) ); -} - -/****************************************************************************** - * CLSIDFromString [COMPOBJ.20] - * Converts a unique identifier from its string representation into - * the GUID struct. - * - * Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6] - * - * RETURNS - * the converted GUID - */ -HRESULT WINAPI CLSIDFromString16( - LPCOLESTR16 idstr, /* [in] string representation of guid */ - CLSID *id) /* [out] GUID converted from string */ -{ - const BYTE *s; - int i; - BYTE table[256]; - - if (!idstr) { - memset( id, 0, sizeof (CLSID) ); - return S_OK; - } - - /* validate the CLSID string */ - if (strlen(idstr) != 38) - return CO_E_CLASSSTRING; - - s = (const BYTE *) idstr; - if ((s[0]!='{') || (s[9]!='-') || (s[14]!='-') || (s[19]!='-') || (s[24]!='-') || (s[37]!='}')) - return CO_E_CLASSSTRING; - - for (i=1; i<37; i++) { - if ((i == 9)||(i == 14)||(i == 19)||(i == 24)) continue; - if (!(((s[i] >= '0') && (s[i] <= '9')) || - ((s[i] >= 'a') && (s[i] <= 'f')) || - ((s[i] >= 'A') && (s[i] <= 'F')))) - return CO_E_CLASSSTRING; - } - - TRACE("%s -> %p\n", s, id); - - /* quick lookup table */ - memset(table, 0, 256); - - for (i = 0; i < 10; i++) { - table['0' + i] = i; - } - for (i = 0; i < 6; i++) { - table['A' + i] = i+10; - table['a' + i] = i+10; - } - - /* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */ - - id->Data1 = (table[s[1]] << 28 | table[s[2]] << 24 | table[s[3]] << 20 | table[s[4]] << 16 | - table[s[5]] << 12 | table[s[6]] << 8 | table[s[7]] << 4 | table[s[8]]); - id->Data2 = table[s[10]] << 12 | table[s[11]] << 8 | table[s[12]] << 4 | table[s[13]]; - id->Data3 = table[s[15]] << 12 | table[s[16]] << 8 | table[s[17]] << 4 | table[s[18]]; - - /* these are just sequential bytes */ - id->Data4[0] = table[s[20]] << 4 | table[s[21]]; - id->Data4[1] = table[s[22]] << 4 | table[s[23]]; - id->Data4[2] = table[s[25]] << 4 | table[s[26]]; - id->Data4[3] = table[s[27]] << 4 | table[s[28]]; - id->Data4[4] = table[s[29]] << 4 | table[s[30]]; - id->Data4[5] = table[s[31]] << 4 | table[s[32]]; - id->Data4[6] = table[s[33]] << 4 | table[s[34]]; - id->Data4[7] = table[s[35]] << 4 | table[s[36]]; - - return S_OK; -} - -/****************************************************************************** - * _xmalloc16 [internal] - * Allocates size bytes from the standard ole16 allocator. - * - * RETURNS - * the allocated segmented pointer and a HRESULT - */ -static HRESULT -_xmalloc16(DWORD size, SEGPTR *ptr) { - LPMALLOC16 mllc; - DWORD args[2]; - - if (CoGetMalloc16(0,&mllc)) - return E_OUTOFMEMORY; - - args[0] = (DWORD)mllc; - args[1] = size; - /* No need for a Callback entry, we have WOWCallback16Ex which does - * everything we need. - */ - if (!WOWCallback16Ex( - (DWORD)((const IMalloc16Vtbl*)MapSL( - (SEGPTR)((LPMALLOC16)MapSL((SEGPTR)mllc))->lpVtbl ) - )->Alloc, - WCB16_CDECL, - 2*sizeof(DWORD), - (LPVOID)args, - (LPDWORD)ptr - )) { - ERR("CallTo16 IMalloc16 (%d) failed\n",size); - return E_FAIL; - } - return S_OK; -} - -/****************************************************************************** - * StringFromCLSID [COMPOBJ.19] - * Converts a GUID into the respective string representation. - * The target string is allocated using the OLE IMalloc. - * - * RETURNS - * the string representation and HRESULT - */ - -HRESULT WINAPI StringFromCLSID16( - REFCLSID id, /* [in] the GUID to be converted */ - LPOLESTR16 *idstr /* [out] a pointer to a to-be-allocated segmented pointer pointing to the resulting string */ - -) { - HRESULT ret; - - ret = _xmalloc16(40,(SEGPTR*)idstr); - if (ret != S_OK) - return ret; - return WINE_StringFromCLSID(id,MapSL((SEGPTR)*idstr)); -} - -/****************************************************************************** - * ProgIDFromCLSID [COMPOBJ.62] - * - * Converts a class id into the respective Program ID. (By using a registry lookup) - * - * RETURNS - * S_OK on success - * riid associated with the progid - */ -HRESULT WINAPI ProgIDFromCLSID16( - REFCLSID clsid, /* [in] class id as found in registry */ - LPOLESTR16 *lplpszProgID/* [out] associated Program ID */ -) { - static const WCHAR wszProgID[] = {'P','r','o','g','I','D',0}; - HKEY hkey; - HRESULT ret; - LONG len; - char *buffer; - - ret = COM_OpenKeyForCLSID(clsid, wszProgID, KEY_READ, &hkey); - if (FAILED(ret)) - return ret; - - if (RegQueryValueA(hkey, NULL, NULL, &len)) - ret = REGDB_E_READREGDB; - - if (ret == S_OK) - { - buffer = HeapAlloc(GetProcessHeap(), 0, len); - if (RegQueryValueA(hkey, NULL, buffer, &len)) - ret = REGDB_E_READREGDB; - - if (ret == S_OK) - { - ret = _xmalloc16(len, (SEGPTR*)lplpszProgID); - if (ret == S_OK) - strcpy(MapSL((SEGPTR)*lplpszProgID),buffer); - } - HeapFree(GetProcessHeap(), 0, buffer); - } - RegCloseKey(hkey); - return ret; -} - -/*********************************************************************** - * LookupETask (COMPOBJ.94) - */ -HRESULT WINAPI LookupETask16(HTASK16 *hTask,LPVOID p) { - FIXME("(%p,%p),stub!\n",hTask,p); - if ((*hTask = GetCurrentTask()) == hETask) { - memcpy(p, Table_ETask, sizeof(Table_ETask)); - } - return 0; -} - -/*********************************************************************** - * SetETask (COMPOBJ.95) - */ -HRESULT WINAPI SetETask16(HTASK16 hTask, LPVOID p) { - FIXME("(%04x,%p),stub!\n",hTask,p); - hETask = hTask; - return 0; -} - -/*********************************************************************** - * CALLOBJECTINWOW (COMPOBJ.201) - */ -HRESULT WINAPI CallObjectInWOW(LPVOID p1,LPVOID p2) { - FIXME("(%p,%p),stub!\n",p1,p2); - return 0; -} - -/****************************************************************************** - * CoRegisterClassObject [COMPOBJ.5] - * - * Don't know where it registers it ... - */ -HRESULT WINAPI CoRegisterClassObject16( - REFCLSID rclsid, - LPUNKNOWN pUnk, - DWORD dwClsContext, /* [in] CLSCTX flags indicating the context in which to run the executable */ - DWORD flags, /* [in] REGCLS flags indicating how connections are made */ - LPDWORD lpdwRegister -) { - FIXME("(%s,%p,0x%08x,0x%08x,%p),stub\n", - debugstr_guid(rclsid),pUnk,dwClsContext,flags,lpdwRegister - ); - return 0; -} - -/****************************************************************************** - * CoRevokeClassObject [COMPOBJ.6] - * - */ -HRESULT WINAPI CoRevokeClassObject16(DWORD dwRegister) /* [in] token on class obj */ -{ - FIXME("(0x%08x),stub!\n", dwRegister); - return 0; -} - -/****************************************************************************** - * CoFileTimeToDosDateTime [COMPOBJ.30] - */ -BOOL16 WINAPI CoFileTimeToDosDateTime16(const FILETIME *ft, LPWORD lpDosDate, LPWORD lpDosTime) -{ - return FileTimeToDosDateTime(ft, lpDosDate, lpDosTime); -} - -/****************************************************************************** - * CoDosDateTimeToFileTime [COMPOBJ.31] - */ -BOOL16 WINAPI CoDosDateTimeToFileTime16(WORD wDosDate, WORD wDosTime, FILETIME *ft) -{ - return DosDateTimeToFileTime(wDosDate, wDosTime, ft); -} - -/****************************************************************************** - * CoRegisterMessageFilter [COMPOBJ.27] - */ -HRESULT WINAPI CoRegisterMessageFilter16( - LPMESSAGEFILTER lpMessageFilter, - LPMESSAGEFILTER *lplpMessageFilter -) { - FIXME("(%p,%p),stub!\n",lpMessageFilter,lplpMessageFilter); - return 0; -} - -/****************************************************************************** - * CoLockObjectExternal [COMPOBJ.63] - */ -HRESULT WINAPI CoLockObjectExternal16( - LPUNKNOWN pUnk, /* [in] object to be locked */ - BOOL16 fLock, /* [in] do lock */ - BOOL16 fLastUnlockReleases /* [in] ? */ -) { - FIXME("(%p,%d,%d),stub!\n",pUnk,fLock,fLastUnlockReleases); - return S_OK; -} - -/*********************************************************************** - * CoGetState [COMPOBJ.115] - */ -HRESULT WINAPI CoGetState16(LPDWORD state) -{ - FIXME("(%p),stub!\n", state); - - *state = 0; - return S_OK; -} - -/*********************************************************************** - * DllEntryPoint [COMPOBJ.116] - * - * Initialization code for the COMPOBJ DLL - * - * RETURNS: - */ -BOOL WINAPI COMPOBJ_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD HeapSize, DWORD res1, WORD res2) -{ - TRACE("(%08x, %04x, %04x, %04x, %08x, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2); - return TRUE; -} - -/*********************************************************************** - * CoMemAlloc [COMPOBJ.151] - */ -SEGPTR WINAPI CoMemAlloc(DWORD size, DWORD dwMemContext, DWORD x) { - HRESULT hres; - SEGPTR segptr; - - /* FIXME: check context handling */ - TRACE("(%d, 0x%08x, 0x%08x)\n", size, dwMemContext, x); - hres = _xmalloc16(size, &segptr); - if (hres != S_OK) - return 0; - return segptr; -} - -/****************************************************************************** - * CLSIDFromProgID [COMPOBJ.61] - * - * Converts a program ID into the respective GUID. - * - * PARAMS - * progid [I] program id as found in registry - * riid [O] associated CLSID - * - * RETURNS - * Success: S_OK - * Failure: CO_E_CLASSSTRING - the given ProgID cannot be found. - */ -HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid) -{ - char *buf,buf2[80]; - LONG buf2len; - HRESULT err; - HKEY xhkey; - - buf = HeapAlloc(GetProcessHeap(),0,strlen(progid)+8); - sprintf(buf,"%s\\CLSID",progid); - if ((err=RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&xhkey))) { - HeapFree(GetProcessHeap(),0,buf); - return CO_E_CLASSSTRING; - } - HeapFree(GetProcessHeap(),0,buf); - buf2len = sizeof(buf2); - if ((err=RegQueryValueA(xhkey,NULL,buf2,&buf2len))) { - RegCloseKey(xhkey); - return CO_E_CLASSSTRING; - } - RegCloseKey(xhkey); - return CLSIDFromString16(buf2,riid); -} - -/*********************************************************************** - * CoGetClassObject [COMPOBJ.7] - * - */ -HRESULT WINAPI CoGetClassObject16( - REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, - REFIID iid, LPVOID *ppv) -{ - FIXME(", stub!\n\tCLSID:\t%s,\n\tIID:\t%s\n", debugstr_guid(rclsid), debugstr_guid(iid)); - - if (pServerInfo) { - FIXME("\tpServerInfo: name=%s\n",debugstr_w(pServerInfo->pwszName)); - FIXME("\t\tpAuthInfo=%p\n",pServerInfo->pAuthInfo); - } - return E_NOTIMPL; -} - -/*********************************************************************** - * CoCreateInstance [COMPOBJ.13] - */ -HRESULT WINAPI CoCreateInstance16( - REFCLSID rclsid, - LPUNKNOWN pUnkOuter, - DWORD dwClsContext, - REFIID iid, - LPVOID *ppv) -{ - FIXME("(%s, %p, %x, %s, %p), stub!\n", - debugstr_guid(rclsid), pUnkOuter, dwClsContext, debugstr_guid(iid), - ppv - ); - return E_NOTIMPL; -} - -/*********************************************************************** - * CoDisconnectObject [COMPOBJ.15] - */ -HRESULT WINAPI CoDisconnectObject16( LPUNKNOWN lpUnk, DWORD reserved ) -{ - FIXME("(%p, 0x%08x): stub!\n", lpUnk, reserved); - return E_NOTIMPL; -} - -/*********************************************************************** - * DllGetClassObject [OLE2.4] - */ -HRESULT WINAPI DllGetClassObject16(REFCLSID rclsid, REFIID iid, LPVOID *ppv) -{ - FIXME("(%s, %s, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv); - return E_NOTIMPL; -} - -/****************************************************************************** - * GetRunningObjectTable (OLE2.30) - */ -HRESULT WINAPI -GetRunningObjectTable16(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot) -{ - FIXME("(%d,%p),stub!\n",reserved,pprot); - return E_NOTIMPL; -} Modified: trunk/reactos/dll/win32/ole32/stg_bigblockfile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/stg_bigblo…
============================================================================== --- trunk/reactos/dll/win32/ole32/stg_bigblockfile.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/stg_bigblockfile.c [iso-8859-1] Sun Mar 21 14:00:22 2010 @@ -63,18 +63,9 @@ /* We map in PAGE_SIZE-sized chunks. Must be a multiple of 4096. */ #define PAGE_SIZE 131072 -#define BLOCKS_PER_PAGE (PAGE_SIZE / BIG_BLOCK_SIZE) - /* We keep a list of recently-discarded pages. This controls the * size of that list. */ #define MAX_VICTIM_PAGES 16 - -/* This structure provides one bit for each block in a page. - * Use BIGBLOCKFILE_{Test,Set,Clear}Bit to manipulate it. */ -typedef struct -{ - unsigned int bits[BLOCKS_PER_PAGE / (CHAR_BIT * sizeof(unsigned int))]; -} BlockBits; /*** * This structure identifies the paged that are mapped @@ -96,16 +87,12 @@ DWORD mapped_bytes; LPVOID lpBytes; LONG refcnt; - - BlockBits readable_blocks; - BlockBits writable_blocks; }; struct BigBlockFile { BOOL fileBased; ULARGE_INTEGER filesize; - ULONG blocksize; HANDLE hfile; HANDLE hfilemap; DWORD flProtect; @@ -122,39 +109,6 @@ /* Note that this evaluates a and b multiple times, so don't * pass expressions with side effects. */ #define ROUND_UP(a, b) ((((a) + (b) - 1)/(b))*(b)) - -/*********************************************************** - * Blockbits functions. - */ -static inline BOOL BIGBLOCKFILE_TestBit(const BlockBits *bb, - unsigned int index) -{ - unsigned int array_index = index / (CHAR_BIT * sizeof(unsigned int)); - unsigned int bit_index = index % (CHAR_BIT * sizeof(unsigned int)); - - return bb->bits[array_index] & (1 << bit_index); -} - -static inline void BIGBLOCKFILE_SetBit(BlockBits *bb, unsigned int index) -{ - unsigned int array_index = index / (CHAR_BIT * sizeof(unsigned int)); - unsigned int bit_index = index % (CHAR_BIT * sizeof(unsigned int)); - - bb->bits[array_index] |= (1 << bit_index); -} - -static inline void BIGBLOCKFILE_ClearBit(BlockBits *bb, unsigned int index) -{ - unsigned int array_index = index / (CHAR_BIT * sizeof(unsigned int)); - unsigned int bit_index = index % (CHAR_BIT * sizeof(unsigned int)); - - bb->bits[array_index] &= ~(1 << bit_index); -} - -static inline void BIGBLOCKFILE_Zero(BlockBits *bb) -{ - memset(bb->bits, 0, sizeof(bb->bits)); -} /****************************************************************************** * BIGBLOCKFILE_FileInit @@ -302,9 +256,6 @@ return NULL; } - BIGBLOCKFILE_Zero(&page->readable_blocks); - BIGBLOCKFILE_Zero(&page->writable_blocks); - return page; } @@ -328,9 +279,6 @@ if (page) { This->num_victim_pages--; - - BIGBLOCKFILE_Zero(&page->readable_blocks); - BIGBLOCKFILE_Zero(&page->writable_blocks); } } @@ -709,7 +657,7 @@ * and the blocks in use list. */ BigBlockFile *BIGBLOCKFILE_Construct(HANDLE hFile, ILockBytes* pLkByt, DWORD openFlags, - ULONG blocksize, BOOL fileBased) + BOOL fileBased) { BigBlockFile *This; @@ -720,7 +668,6 @@ This->fileBased = fileBased; This->flProtect = BIGBLOCKFILE_GetProtectMode(openFlags); - This->blocksize = blocksize; This->maplist = NULL; This->victimhead = NULL; @@ -863,31 +810,19 @@ } /****************************************************************************** - * BIGBLOCKFILE_EnsureExists - * - * Grows the file if necessary to make sure the block is valid. - */ -HRESULT BIGBLOCKFILE_EnsureExists(BigBlockFile *This, ULONG index) + * BIGBLOCKFILE_Expand + * + * Grows the file to the specified size if necessary. + */ +HRESULT BIGBLOCKFILE_Expand(BigBlockFile *This, ULARGE_INTEGER newSize) { ULARGE_INTEGER size; HRESULT hr; - /* Block index starts at -1 translate to zero based index */ - if (index == 0xffffffff) - index = 0; - else - index++; - hr = BIGBLOCKFILE_GetSize(This, &size); if(FAILED(hr)) return hr; - /* make sure that the block physically exists */ - if ((This->blocksize * (index + 1)) > size.QuadPart) - { - ULARGE_INTEGER newSize; - - newSize.QuadPart = This->blocksize * (index + 1); + if (newSize.QuadPart > size.QuadPart) hr = BIGBLOCKFILE_SetSize(This, newSize); - } return hr; } Modified: trunk/reactos/dll/win32/ole32/stg_prop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/stg_prop.c…
============================================================================== --- trunk/reactos/dll/win32/ole32/stg_prop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/stg_prop.c [iso-8859-1] Sun Mar 21 14:00:22 2010 @@ -181,7 +181,9 @@ { PropertyStorage_impl *This = (PropertyStorage_impl *)iface; - if ( (This==0) || (ppvObject==0) ) + TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObject); + + if (!ppvObject) return E_INVALIDARG; *ppvObject = 0; Modified: trunk/reactos/dll/win32/ole32/storage32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.…
============================================================================== --- trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/storage32.c [iso-8859-1] Sun Mar 21 14:00:22 2010 @@ -269,14 +269,9 @@ ** Block Functions */ -static ULONG BLOCK_GetBigBlockOffset(ULONG index) -{ - if (index == 0xffffffff) - index = 0; - else - index ++; - - return index * BIG_BLOCK_SIZE; +static ULONG StorageImpl_GetBigBlockOffset(StorageImpl* This, ULONG index) +{ + return (index+1) * This->bigBlockSize; } /************************************************************************ @@ -1599,11 +1594,15 @@ SNB snbExclude, /* [unique][in] */ IStorage* pstgDest) /* [unique][in] */ { + StorageBaseImpl* const This=(StorageBaseImpl*)iface; + IEnumSTATSTG *elements = 0; STATSTG curElement, strStat; HRESULT hr; IStorage *pstgTmp, *pstgChild; IStream *pstrTmp, *pstrChild; + DirRef srcEntryRef; + DirEntry srcEntry; BOOL skip = FALSE, skip_storage = FALSE, skip_stream = FALSE; int i; @@ -1728,11 +1727,25 @@ goto cleanup; /* - * open child stream storage + * open child stream storage. This operation must succeed even if the + * stream is already open, so we use internal functions to do it. */ - hr = IStorage_OpenStream( iface, curElement.pwcsName, NULL, - STGM_READ|STGM_SHARE_EXCLUSIVE, - 0, &pstrChild ); + srcEntryRef = findElement( This, This->storageDirEntry, curElement.pwcsName, + &srcEntry); + if (!srcEntryRef) + { + ERR("source stream not found\n"); + hr = STG_E_DOCFILECORRUPT; + } + + if (hr == S_OK) + { + pstrChild = (IStream*)StgStreamImpl_Construct(This, STGM_READ|STGM_SHARE_EXCLUSIVE, srcEntryRef); + if (pstrChild) + IStream_AddRef(pstrChild); + else + hr = E_OUTOFMEMORY; + } if (hr == S_OK) { @@ -2626,7 +2639,6 @@ This->bigBlockFile = BIGBLOCKFILE_Construct(hFile, pLkbyt, openFlags, - This->bigBlockSize, fileBased); if (This->bigBlockFile == 0) @@ -2638,7 +2650,7 @@ if (create) { ULARGE_INTEGER size; - BYTE bigBlockBuffer[BIG_BLOCK_SIZE]; + BYTE bigBlockBuffer[MAX_BIG_BLOCK_SIZE]; /* * Initialize all header variables: @@ -2835,13 +2847,14 @@ StorageImpl* This) { ULONG depotBlockIndexPos; - BYTE depotBuffer[BIG_BLOCK_SIZE]; + BYTE depotBuffer[MAX_BIG_BLOCK_SIZE]; BOOL success; ULONG depotBlockOffset; ULONG blocksPerDepot = This->bigBlockSize / sizeof(ULONG); ULONG nextBlockIndex = BLOCK_SPECIAL; int depotIndex = 0; ULONG freeBlock = BLOCK_UNUSED; + ULARGE_INTEGER neededSize; depotIndex = This->prevFreeBlock / blocksPerDepot; depotBlockOffset = (This->prevFreeBlock % blocksPerDepot) * sizeof(ULONG); @@ -2955,7 +2968,8 @@ /* * make sure that the block physically exists before using it */ - BIGBLOCKFILE_EnsureExists(This->bigBlockFile, freeBlock); + neededSize.QuadPart = StorageImpl_GetBigBlockOffset(This, freeBlock)+This->bigBlockSize; + BIGBLOCKFILE_Expand(This->bigBlockFile, neededSize); This->prevFreeBlock = freeBlock; @@ -2970,7 +2984,7 @@ */ static void Storage32Impl_AddBlockDepot(StorageImpl* This, ULONG blockIndex) { - BYTE blockBuffer[BIG_BLOCK_SIZE]; + BYTE blockBuffer[MAX_BIG_BLOCK_SIZE]; /* * Initialize blocks as free @@ -3053,7 +3067,7 @@ { ULONG numExtBlocks = This->extBigBlockDepotCount; ULONG nextExtBlock = This->extBigBlockDepotStart; - BYTE depotBuffer[BIG_BLOCK_SIZE]; + BYTE depotBuffer[MAX_BIG_BLOCK_SIZE]; ULONG index = BLOCK_UNUSED; ULONG nextBlockOffset = This->bigBlockSize - sizeof(ULONG); ULONG blocksPerDepotBlock = This->bigBlockSize / sizeof(ULONG); @@ -3143,10 +3157,10 @@ ULONG offsetInDepot = blockIndex * sizeof (ULONG); ULONG depotBlockCount = offsetInDepot / This->bigBlockSize; ULONG depotBlockOffset = offsetInDepot % This->bigBlockSize; - BYTE depotBuffer[BIG_BLOCK_SIZE]; + BYTE depotBuffer[MAX_BIG_BLOCK_SIZE]; BOOL success; ULONG depotBlockIndexPos; - int index; + int index, num_blocks; *nextBlockIndex = BLOCK_SPECIAL; @@ -3181,7 +3195,9 @@ if (!success) return STG_E_READFAULT; - for (index = 0; index < NUM_BLOCKS_PER_DEPOT_BLOCK; index++) + num_blocks = This->bigBlockSize / 4; + + for (index = 0; index < num_blocks; index++) { StorageUtl_ReadDWord(depotBuffer, index*sizeof(ULONG), nextBlockIndex); This->blockDepotCached[index] = *nextBlockIndex; @@ -3272,26 +3288,31 @@ /****************************************************************************** * Storage32Impl_LoadFileHeader * - * This method will read in the file header, i.e. big block index -1. + * This method will read in the file header */ static HRESULT StorageImpl_LoadFileHeader( StorageImpl* This) { - HRESULT hr = STG_E_FILENOTFOUND; - BYTE headerBigBlock[BIG_BLOCK_SIZE]; - BOOL success; + HRESULT hr; + BYTE headerBigBlock[HEADER_SIZE]; int index; + ULARGE_INTEGER offset; + DWORD bytes_read; TRACE("\n"); /* * Get a pointer to the big block of data containing the header. */ - success = StorageImpl_ReadBigBlock(This, -1, headerBigBlock); + offset.u.HighPart = 0; + offset.u.LowPart = 0; + hr = StorageImpl_ReadAt(This, offset, headerBigBlock, HEADER_SIZE, &bytes_read); + if (SUCCEEDED(hr) && bytes_read != HEADER_SIZE) + hr = STG_E_FILENOTFOUND; /* * Extract the information from the header. */ - if (success) + if (SUCCEEDED(hr)) { /* * Check for the "magic number" signature and return an error if it is not @@ -3360,7 +3381,7 @@ * Right now, the code is making some assumptions about the size of the * blocks, just make sure they are what we're expecting. */ - if (This->bigBlockSize != DEF_BIG_BLOCK_SIZE || + if ((This->bigBlockSize != MIN_BIG_BLOCK_SIZE && This->bigBlockSize != MAX_BIG_BLOCK_SIZE) || This->smallBlockSize != DEF_SMALL_BLOCK_SIZE) { WARN("Broken OLE storage file\n"); @@ -3376,29 +3397,35 @@ /****************************************************************************** * Storage32Impl_SaveFileHeader * - * This method will save to the file the header, i.e. big block -1. + * This method will save to the file the header */ static void StorageImpl_SaveFileHeader( StorageImpl* This) { - BYTE headerBigBlock[BIG_BLOCK_SIZE]; + BYTE headerBigBlock[HEADER_SIZE]; int index; - BOOL success; + HRESULT hr; + ULARGE_INTEGER offset; + DWORD bytes_read, bytes_written; /* * Get a pointer to the big block of data containing the header. */ - success = StorageImpl_ReadBigBlock(This, -1, headerBigBlock); + offset.u.HighPart = 0; + offset.u.LowPart = 0; + hr = StorageImpl_ReadAt(This, offset, headerBigBlock, HEADER_SIZE, &bytes_read); + if (SUCCEEDED(hr) && bytes_read != HEADER_SIZE) + hr = STG_E_FILENOTFOUND; /* * If the block read failed, the file is probably new. */ - if (!success) + if (FAILED(hr)) { /* * Initialize for all unknown fields. */ - memset(headerBigBlock, 0, BIG_BLOCK_SIZE); + memset(headerBigBlock, 0, HEADER_SIZE); /* * Initialize the magic number. @@ -3469,7 +3496,7 @@ /* * Write the big block back to the file. */ - StorageImpl_WriteBigBlock(This, -1, headerBigBlock); + StorageImpl_WriteAt(This, offset, headerBigBlock, HEADER_SIZE, &bytes_written); } /****************************************************************************** @@ -3711,7 +3738,7 @@ DWORD read; ulOffset.u.HighPart = 0; - ulOffset.u.LowPart = BLOCK_GetBigBlockOffset(blockIndex); + ulOffset.u.LowPart = StorageImpl_GetBigBlockOffset(This, blockIndex); StorageImpl_ReadAt(This, ulOffset, buffer, This->bigBlockSize, &read); return (read == This->bigBlockSize); @@ -3728,7 +3755,7 @@ DWORD tmp; ulOffset.u.HighPart = 0; - ulOffset.u.LowPart = BLOCK_GetBigBlockOffset(blockIndex); + ulOffset.u.LowPart = StorageImpl_GetBigBlockOffset(This, blockIndex); ulOffset.u.LowPart += offset; StorageImpl_ReadAt(This, ulOffset, &tmp, sizeof(DWORD), &read); @@ -3745,7 +3772,7 @@ DWORD wrote; ulOffset.u.HighPart = 0; - ulOffset.u.LowPart = BLOCK_GetBigBlockOffset(blockIndex); + ulOffset.u.LowPart = StorageImpl_GetBigBlockOffset(This, blockIndex); StorageImpl_WriteAt(This, ulOffset, buffer, This->bigBlockSize, &wrote); return (wrote == This->bigBlockSize); @@ -3761,7 +3788,7 @@ DWORD wrote; ulOffset.u.HighPart = 0; - ulOffset.u.LowPart = BLOCK_GetBigBlockOffset(blockIndex); + ulOffset.u.LowPart = StorageImpl_GetBigBlockOffset(This, blockIndex); ulOffset.u.LowPart += offset; value = htole32(value); @@ -5151,7 +5178,7 @@ TRACE("block %i\n",blockIndex); ulOffset.u.HighPart = 0; - ulOffset.u.LowPart = BLOCK_GetBigBlockOffset(blockIndex) + + ulOffset.u.LowPart = StorageImpl_GetBigBlockOffset(This->parentStorage, blockIndex) + offsetInBlock; StorageImpl_ReadAt(This->parentStorage, @@ -5247,7 +5274,7 @@ TRACE("block %i\n",blockIndex); ulOffset.u.HighPart = 0; - ulOffset.u.LowPart = BLOCK_GetBigBlockOffset(blockIndex) + + ulOffset.u.LowPart = StorageImpl_GetBigBlockOffset(This->parentStorage, blockIndex) + offsetInBlock; StorageImpl_WriteAt(This->parentStorage, @@ -5721,7 +5748,7 @@ ULONG sbdIndex = This->parentStorage->smallBlockDepotStart; ULONG nextBlock, newsbdIndex; - BYTE smallBlockDepot[BIG_BLOCK_SIZE]; + BYTE smallBlockDepot[MAX_BIG_BLOCK_SIZE]; nextBlock = sbdIndex; while (nextBlock != BLOCK_END_OF_CHAIN) Modified: trunk/reactos/dll/win32/ole32/storage32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/storage32.…
============================================================================== --- trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/storage32.h [iso-8859-1] Sun Mar 21 14:00:22 2010 @@ -79,6 +79,11 @@ #define RAW_DIRENTRY_SIZE 0x00000080 +#define HEADER_SIZE 512 + +#define MIN_BIG_BLOCK_SIZE 0x200 +#define MAX_BIG_BLOCK_SIZE 0x1000 + /* * Type of child entry link */ @@ -91,15 +96,8 @@ */ #define STGTY_ROOT 0x05 -/* - * These defines assume a hardcoded blocksize. The code will assert - * if the blocksize is different. Some changes will have to be done if it - * becomes the case. - */ -#define BIG_BLOCK_SIZE 0x200 #define COUNT_BBDEPOTINHEADER 109 #define LIMIT_TO_USE_SMALL_BLOCK 0x1000 -#define NUM_BLOCKS_PER_DEPOT_BLOCK 128 #define STGM_ACCESS_MODE(stgm) ((stgm)&0x0000f) #define STGM_SHARE_MODE(stgm) ((stgm)&0x000f0) @@ -163,10 +161,9 @@ BigBlockFile* BIGBLOCKFILE_Construct(HANDLE hFile, ILockBytes* pLkByt, DWORD openFlags, - ULONG blocksize, BOOL fileBased); void BIGBLOCKFILE_Destructor(LPBIGBLOCKFILE This); -HRESULT BIGBLOCKFILE_EnsureExists(LPBIGBLOCKFILE This, ULONG index); +HRESULT BIGBLOCKFILE_Expand(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize); HRESULT BIGBLOCKFILE_SetSize(LPBIGBLOCKFILE This, ULARGE_INTEGER newSize); HRESULT BIGBLOCKFILE_ReadAt(LPBIGBLOCKFILE This, ULARGE_INTEGER offset, void* buffer, ULONG size, ULONG* bytesRead); @@ -359,7 +356,7 @@ ULONG extBigBlockDepotCount; ULONG bigBlockDepotStart[COUNT_BBDEPOTINHEADER]; - ULONG blockDepotCached[NUM_BLOCKS_PER_DEPOT_BLOCK]; + ULONG blockDepotCached[MAX_BIG_BLOCK_SIZE / 4]; ULONG indexBlockDepotCached; ULONG prevFreeBlock;
14 years, 9 months
1
0
0
0
[cwittich] 46294: [WIDL] sync widl with wine 1.1.41
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Mar 21 13:47:24 2010 New Revision: 46294 URL:
http://svn.reactos.org/svn/reactos?rev=46294&view=rev
Log: [WIDL] sync widl with wine 1.1.41 Modified: trunk/reactos/tools/widl/client.c trunk/reactos/tools/widl/parser.tab.c trunk/reactos/tools/widl/parser.y trunk/reactos/tools/widl/typegen.c trunk/reactos/tools/widl/typegen.h trunk/reactos/tools/widl/widltypes.h Modified: trunk/reactos/tools/widl/client.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/client.c?rev=46…
============================================================================== --- trunk/reactos/tools/widl/client.c [iso-8859-1] (original) +++ trunk/reactos/tools/widl/client.c [iso-8859-1] Sun Mar 21 13:47:24 2010 @@ -126,8 +126,6 @@ print_client( " struct __frame_%s%s *__frame )\n{\n", prefix_client, get_name(func) ); indent++; - /* FIXME: emit client finally code */ - if (has_full_pointer) write_full_pointer_free(client, indent, func); Modified: trunk/reactos/tools/widl/parser.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.tab.c?re…
============================================================================== --- trunk/reactos/tools/widl/parser.tab.c [iso-8859-1] (original) +++ trunk/reactos/tools/widl/parser.tab.c [iso-8859-1] Sun Mar 21 13:47:24 2010 @@ -6423,7 +6423,6 @@ case TYPE_BASIC_HYPER: case TYPE_BASIC_BYTE: case TYPE_BASIC_WCHAR: - case TYPE_BASIC_ERROR_STATUS_T: return TRUE; default: return FALSE; Modified: trunk/reactos/tools/widl/parser.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.y?rev=46…
============================================================================== --- trunk/reactos/tools/widl/parser.y [iso-8859-1] (original) +++ trunk/reactos/tools/widl/parser.y [iso-8859-1] Sun Mar 21 13:47:24 2010 @@ -2261,7 +2261,6 @@ case TYPE_BASIC_HYPER: case TYPE_BASIC_BYTE: case TYPE_BASIC_WCHAR: - case TYPE_BASIC_ERROR_STATUS_T: return TRUE; default: return FALSE; Modified: trunk/reactos/tools/widl/typegen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typegen.c?rev=4…
============================================================================== --- trunk/reactos/tools/widl/typegen.c [iso-8859-1] (original) +++ trunk/reactos/tools/widl/typegen.c [iso-8859-1] Sun Mar 21 13:47:24 2010 @@ -57,6 +57,14 @@ const type_t *structure; unsigned int baseoff; const expr_t *expr; +}; + +enum type_context +{ + TYPE_CONTEXT_TOPLEVELPARAM, + TYPE_CONTEXT_PARAM, + TYPE_CONTEXT_CONTAINER, + TYPE_CONTEXT_CONTAINER_NO_POINTERS, }; static unsigned int field_memsize(const type_t *type, unsigned int *offset); @@ -202,6 +210,30 @@ return RPC_FC_ENUM16; } +static type_t *get_user_type(const type_t *t, const char **pname) +{ + for (;;) + { + type_t *ut = get_attrp(t->attrs, ATTR_WIREMARSHAL); + if (ut) + { + if (pname) + *pname = t->name; + return ut; + } + + if (type_is_alias(t)) + t = type_alias_get_aliasee(t); + else + return NULL; + } +} + +static int is_user_type(const type_t *t) +{ + return get_user_type(t, NULL) != NULL; +} + enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *attrs, unsigned int flags) { if (is_user_type(type)) @@ -252,6 +284,29 @@ return TGT_INVALID; } +static int get_padding(const var_list_t *fields) +{ + unsigned short offset = 0; + unsigned int salign = 1; + const var_t *f; + + if (!fields) + return 0; + + LIST_FOR_EACH_ENTRY(f, fields, const var_t, entry) + { + type_t *ft = f->type; + unsigned int align = 0; + unsigned int size = type_memsize(ft, &align); + align = clamp_align(align); + if (align > salign) salign = align; + offset = ROUND_SIZE(offset, align); + offset += size; + } + + return ROUNDING(offset, salign); +} + unsigned char get_struct_fc(const type_t *type) { int has_pointer = 0; @@ -472,22 +527,6 @@ return fc; } -int is_struct(unsigned char type) -{ - switch (type) - { - case RPC_FC_STRUCT: - case RPC_FC_PSTRUCT: - case RPC_FC_CSTRUCT: - case RPC_FC_CPSTRUCT: - case RPC_FC_CVSTRUCT: - case RPC_FC_BOGUS_STRUCT: - return 1; - default: - return 0; - } -} - static int is_non_complex_struct(const type_t *type) { return (type_get_type(type) == TYPE_STRUCT && @@ -624,30 +663,6 @@ type->tfswrite = FALSE; else type->typestring_offset = 1; -} - -static type_t *get_user_type(const type_t *t, const char **pname) -{ - for (;;) - { - type_t *ut = get_attrp(t->attrs, ATTR_WIREMARSHAL); - if (ut) - { - if (pname) - *pname = t->name; - return ut; - } - - if (type_is_alias(t)) - t = type_alias_get_aliasee(t); - else - return NULL; - } -} - -int is_user_type(const type_t *t) -{ - return get_user_type(t, NULL) != NULL; } static int is_embedded_complex(const type_t *type) @@ -1075,6 +1090,13 @@ else param_type = RPC_FC_SHORT; } + else if (type_get_type(correlation_variable) == TYPE_POINTER) + { + if (pointer_size == 8) + param_type = RPC_FC_HYPER; + else + param_type = RPC_FC_LONG; + } else { error("write_conf_or_var_desc: non-arithmetic type used as correlation variable %s\n", @@ -1096,8 +1118,10 @@ LIST_FOR_EACH_ENTRY(eval, &expr_eval_routines, struct expr_eval_routine, entry) { - if (!strcmp (eval->structure->name, structure->name) - && !compare_expr (eval->expr, expr)) + if (eval->structure == structure || + (eval->structure->name && structure->name && + !strcmp(eval->structure->name, structure->name) && + !compare_expr(eval->expr, expr))) { found = 1; break; @@ -1175,29 +1199,6 @@ } return maxs; -} - -int get_padding(const var_list_t *fields) -{ - unsigned short offset = 0; - unsigned int salign = 1; - const var_t *f; - - if (!fields) - return 0; - - LIST_FOR_EACH_ENTRY(f, fields, const var_t, entry) - { - type_t *ft = f->type; - unsigned int align = 0; - unsigned int size = type_memsize(ft, &align); - align = clamp_align(align); - if (align > salign) salign = align; - offset = ROUND_SIZE(offset, align); - offset += size; - } - - return ROUNDING(offset, salign); } unsigned int type_memsize(const type_t *t, unsigned int *align) @@ -1355,7 +1356,7 @@ if (out_attr && !in_attr && pointer_type == RPC_FC_RP) flags |= RPC_FC_P_ONSTACK; - if (is_ptr(type) && !last_ptr(type)) + if (is_ptr(type) && is_declptr(type_pointer_get_ref(type))) flags |= RPC_FC_P_DEREF; print_file(file, 2, "0x%x, 0x%x,\t\t/* %s", @@ -1382,6 +1383,9 @@ unsigned char fc; unsigned char pointer_fc; const type_t *ref; + int in_attr = is_attr(attrs, ATTR_IN); + int out_attr = is_attr(attrs, ATTR_OUT); + unsigned char flags = RPC_FC_P_SIMPLEPOINTER; /* for historical reasons, write_simple_pointer also handled string types, * but no longer does. catch bad uses of the function with this check */ @@ -1396,8 +1400,12 @@ else fc = get_basic_fc(ref); - print_file(file, 2, "0x%02x, 0x%x,\t/* %s [simple_pointer] */\n", - pointer_fc, RPC_FC_P_SIMPLEPOINTER, string_of_type(pointer_fc)); + if (out_attr && !in_attr) + flags |= RPC_FC_P_ONSTACK; + + print_file(file, 2, "0x%02x, 0x%x,\t/* %s %s[simple_pointer] */\n", + pointer_fc, flags, string_of_type(pointer_fc), + flags & RPC_FC_P_ONSTACK ? "[allocated_on_stack] " : ""); print_file(file, 2, "0x%02x,\t/* %s */\n", fc, string_of_type(fc)); print_file(file, 2, "0x5c,\t/* FC_PAD */\n"); return 4; @@ -1411,7 +1419,8 @@ } static unsigned int write_pointer_tfs(FILE *file, const attr_list_t *attrs, - type_t *type, int toplevel_param, + type_t *type, unsigned int ref_offset, + int toplevel_param, unsigned int *typestring_offset) { unsigned int offset = *typestring_offset; @@ -1420,15 +1429,21 @@ print_start_tfs_comment(file, type, offset); update_tfsoff(type, offset, file); - if (ref->typestring_offset) - write_nonsimple_pointer(file, attrs, type, - toplevel_param, - type_pointer_get_ref(type)->typestring_offset, - typestring_offset); - else if (type_get_type(ref) == TYPE_BASIC || - type_get_type(ref) == TYPE_ENUM) + switch (typegen_detect_type(ref, attrs, TDT_ALL_TYPES)) + { + case TGT_BASIC: + case TGT_ENUM: *typestring_offset += write_simple_pointer(file, attrs, type, toplevel_param); + break; + default: + if (ref_offset) + write_nonsimple_pointer(file, attrs, type, + toplevel_param, + ref_offset, + typestring_offset); + break; + } return offset; } @@ -1540,8 +1555,10 @@ reloff = absoff - (*tfsoff + 2); print_file(file, 2, "0x4c,\t/* FC_EMBEDDED_COMPLEX */\n"); - /* FIXME: actually compute necessary padding */ - print_file(file, 2, "0x0,\t/* FIXME: padding */\n"); + /* padding is represented using FC_STRUCTPAD* types, so presumably + * this is left over in the format for historical purposes in MIDL + * or rpcrt4. */ + print_file(file, 2, "0x0,\n"); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n", reloff, reloff, absoff); *tfsoff += 4; @@ -1636,8 +1653,11 @@ { unsigned int memsize; - /* pointer instance */ - /* FIXME: sometimes from end of structure, sometimes from beginning */ + /* pointer instance + * + * note that MSDN states that for pointer layouts in structures, + * this is a negative offset from the end of the structure, but + * this statement is incorrect. all offsets are positive */ print_file(file, 2, "NdrFcShort(0x%hx),\t/* Memory offset = %d */\n", *offset_in_memory, *offset_in_memory); print_file(file, 2, "NdrFcShort(0x%hx),\t/* Buffer offset = %d */\n", *offset_in_buffer, *offset_in_buffer); @@ -2139,7 +2159,6 @@ unsigned int size; unsigned int start_offset; unsigned char fc; - int has_pointer; int pointer_type = get_attrv(attrs, ATTR_POINTERTYPE); unsigned int baseoff = !type_array_is_decl_as_ptr(type) && current_structure @@ -2149,10 +2168,7 @@ if (!pointer_type) pointer_type = RPC_FC_RP; - if (write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset)) - has_pointer = TRUE; - else - has_pointer = type_has_pointers(type_array_get_element(type)); + write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset); align = 0; size = type_memsize((is_conformant_array(type) ? type_array_get_element(type) : type), &align); @@ -2210,7 +2226,8 @@ += write_conf_or_var_desc(file, current_structure, baseoff, type, length_is); - if (has_pointer && (type_array_is_decl_as_ptr(type) || !current_structure)) + if (type_has_pointers(type_array_get_element(type)) && + (type_array_is_decl_as_ptr(type) || !current_structure)) { print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); @@ -2330,7 +2347,6 @@ const var_t *array; unsigned int start_offset; unsigned int array_offset; - int has_pointers = 0; unsigned int align = 0; unsigned int corroff; var_t *f; @@ -2346,9 +2362,7 @@ name, USHRT_MAX, total_size - USHRT_MAX); if (fields) LIST_FOR_EACH_ENTRY(f, fields, var_t, entry) - has_pointers |= write_embedded_types(file, f->attrs, f->type, f->name, - FALSE, tfsoff); - if (!has_pointers) has_pointers = type_has_pointers(type); + write_embedded_types(file, f->attrs, f->type, f->name, FALSE, tfsoff); array = find_array_or_string_in_struct(type); if (array && !processed(array->type)) @@ -2396,7 +2410,7 @@ } else if ((fc == RPC_FC_PSTRUCT) || (fc == RPC_FC_CPSTRUCT) || - (fc == RPC_FC_CVSTRUCT && has_pointers)) + (fc == RPC_FC_CVSTRUCT && type_has_pointers(type))) { print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); @@ -2417,25 +2431,33 @@ if (fields) LIST_FOR_EACH_ENTRY(f, fields, const var_t, entry) { type_t *ft = f->type; - if (is_ptr(ft)) + switch (typegen_detect_type(ft, f->attrs, TDT_IGNORE_STRINGS)) { + case TGT_POINTER: if (is_string_type(f->attrs, ft)) write_string_tfs(file, f->attrs, ft, FALSE, f->name, tfsoff); else - write_pointer_tfs(file, f->attrs, ft, FALSE, tfsoff); - } - else if (type_get_type(ft) == TYPE_ARRAY && type_array_is_decl_as_ptr(ft)) - { - unsigned int offset; - - print_file(file, 0, "/* %d */\n", *tfsoff); - - offset = ft->typestring_offset; - /* skip over the pointer that is written for strings, since a - * pointer has to be written in-place here */ - if (is_string_type(f->attrs, ft)) - offset += 4; - write_nonsimple_pointer(file, f->attrs, ft, FALSE, offset, tfsoff); + write_pointer_tfs(file, f->attrs, ft, + type_pointer_get_ref(ft)->typestring_offset, + FALSE, tfsoff); + break; + case TGT_ARRAY: + if (type_array_is_decl_as_ptr(ft)) + { + unsigned int offset; + + print_file(file, 0, "/* %d */\n", *tfsoff); + + offset = ft->typestring_offset; + /* skip over the pointer that is written for strings, since a + * pointer has to be written in-place here */ + if (is_string_type(f->attrs, ft)) + offset += 4; + write_nonsimple_pointer(file, f->attrs, ft, FALSE, offset, tfsoff); + } + break; + default: + break; } } if (type->ptrdesc == *tfsoff) @@ -2639,12 +2661,14 @@ unsigned int start_offset = *typeformat_offset; expr_t *iid = get_attrp(attrs, ATTR_IIDIS); + print_start_tfs_comment(file, type, start_offset); + if (iid) { print_file(file, 2, "0x2f, /* FC_IP */\n"); print_file(file, 2, "0x5c, /* FC_PAD */\n"); *typeformat_offset - += write_conf_or_var_desc(file, NULL, 0, type, iid) + 2; + += write_conf_or_var_desc(file, current_structure, 0, type, iid) + 2; } else { @@ -2655,7 +2679,6 @@ error("%s: interface %s missing UUID\n", __FUNCTION__, base->name); update_tfsoff(type, start_offset, file); - print_start_tfs_comment(file, type, start_offset); print_file(file, 2, "0x2f,\t/* FC_IP */\n"); print_file(file, 2, "0x5a,\t/* FC_CONSTANT_IID */\n"); print_file(file, 2, "NdrFcLong(0x%08x),\n", uuid->Data1); @@ -2672,8 +2695,9 @@ return start_offset; } -static unsigned int write_contexthandle_tfs(FILE *file, const type_t *type, - const var_t *var, +static unsigned int write_contexthandle_tfs(FILE *file, + const attr_list_t *attrs, + const type_t *type, unsigned int *typeformat_offset) { unsigned int start_offset = *typeformat_offset; @@ -2684,13 +2708,13 @@ if (is_ptr(type)) flags |= 0x80; - if (is_attr(var->attrs, ATTR_IN)) + if (is_attr(attrs, ATTR_IN)) { flags |= 0x40; - if (!is_attr(var->attrs, ATTR_OUT)) + if (!is_attr(attrs, ATTR_OUT)) flags |= NDR_CONTEXT_HANDLE_CANNOT_BE_NULL; } - if (is_attr(var->attrs, ATTR_OUT)) + if (is_attr(attrs, ATTR_OUT)) flags |= 0x20; WRITE_FCTYPE(file, FC_BIND_CONTEXT, *typeformat_offset); @@ -2747,46 +2771,60 @@ return start_offset; } -static unsigned int write_typeformatstring_var(FILE *file, int indent, const var_t *func, - type_t *type, const var_t *var, - int toplevel_param, - unsigned int *typeformat_offset) +static unsigned int write_type_tfs(FILE *file, int indent, + const attr_list_t *attrs, type_t *type, + const char *name, + enum type_context context, + unsigned int *typeformat_offset) { unsigned int offset; - switch (typegen_detect_type(type, var->attrs, TDT_ALL_TYPES)) + switch (typegen_detect_type(type, attrs, TDT_ALL_TYPES)) { case TGT_CTXT_HANDLE: case TGT_CTXT_HANDLE_POINTER: - return write_contexthandle_tfs(file, type, var, typeformat_offset); + return write_contexthandle_tfs(file, attrs, type, typeformat_offset); case TGT_USER_TYPE: write_user_tfs(file, type, typeformat_offset); return type->typestring_offset; case TGT_STRING: - return write_string_tfs(file, var->attrs, type, toplevel_param, var->name, typeformat_offset); + return write_string_tfs(file, attrs, type, + context == TYPE_CONTEXT_TOPLEVELPARAM, + name, typeformat_offset); case TGT_ARRAY: { - int ptr_type; unsigned int off; - off = write_array_tfs(file, var->attrs, type, var->name, typeformat_offset); - ptr_type = get_pointer_fc(type, var->attrs, toplevel_param); - if (ptr_type != RPC_FC_RP) - { - unsigned int absoff = type->typestring_offset; - short reloff = absoff - (*typeformat_offset + 2); - off = *typeformat_offset; - print_file(file, 0, "/* %d */\n", off); - print_file(file, 2, "0x%x, 0x0,\t/* %s */\n", ptr_type, - string_of_type(ptr_type)); - print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n", - reloff, reloff, absoff); - *typeformat_offset += 4; + /* conformant and pointer arrays are handled specially */ + if ((context != TYPE_CONTEXT_CONTAINER && + context != TYPE_CONTEXT_CONTAINER_NO_POINTERS) || + !is_conformant_array(type) || type_array_is_decl_as_ptr(type)) + off = write_array_tfs(file, attrs, type, name, typeformat_offset); + else + off = 0; + if (context != TYPE_CONTEXT_CONTAINER && + context != TYPE_CONTEXT_CONTAINER_NO_POINTERS) + { + int ptr_type; + ptr_type = get_pointer_fc(type, attrs, + context == TYPE_CONTEXT_TOPLEVELPARAM); + if (ptr_type != RPC_FC_RP) + { + unsigned int absoff = type->typestring_offset; + short reloff = absoff - (*typeformat_offset + 2); + off = *typeformat_offset; + print_file(file, 0, "/* %d */\n", off); + print_file(file, 2, "0x%x, 0x0,\t/* %s */\n", ptr_type, + string_of_type(ptr_type)); + print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n", + reloff, reloff, absoff); + *typeformat_offset += 4; + } } return off; } case TGT_STRUCT: if (processed(type)) return type->typestring_offset; - return write_struct_tfs(file, type, var->name, typeformat_offset); + return write_struct_tfs(file, type, name, typeformat_offset); case TGT_UNION: if (processed(type)) return type->typestring_offset; return write_union_tfs(file, type, typeformat_offset); @@ -2796,131 +2834,46 @@ return 0; case TGT_RANGE: { - expr_list_t *range_list = get_attrp(var->attrs, ATTR_RANGE); - if (!range_list) - range_list = get_aliaschain_attrp(type, ATTR_RANGE); - return write_range_tfs(file, var->attrs, type, range_list, typeformat_offset); - } - case TGT_IFACE_POINTER: - return write_ip_tfs(file, var->attrs, type, typeformat_offset); - case TGT_POINTER: - if (last_ptr(type)) - { - size_t start_offset = *typeformat_offset; - int in_attr = is_attr(var->attrs, ATTR_IN); - int out_attr = is_attr(var->attrs, ATTR_OUT); - const type_t *ref = type_pointer_get_ref(type); - - switch (typegen_detect_type(ref, NULL, TDT_ALL_TYPES)) - { - /* special case for pointers to base types */ - case TGT_BASIC: - case TGT_ENUM: - { - unsigned char fc; - - if (type_get_type(ref) == TYPE_ENUM) - fc = get_enum_fc(ref); - else - fc = get_basic_fc(ref); - - print_file(file, indent, "0x%x, 0x%x, /* %s %s[simple_pointer] */\n", - get_pointer_fc(type, var->attrs, toplevel_param), - (!in_attr && out_attr) ? 0x0C : 0x08, - string_of_type(get_pointer_fc(type, var->attrs, toplevel_param)), - (!in_attr && out_attr) ? "[allocated_on_stack] " : ""); - print_file(file, indent, "0x%02x, /* %s */\n", - fc, string_of_type(fc)); - print_file(file, indent, "0x5c, /* FC_PAD */\n"); - *typeformat_offset += 4; - return start_offset; - } - default: - break; - } - } - - offset = write_typeformatstring_var(file, indent, func, - type_pointer_get_ref(type), var, - FALSE, typeformat_offset); - if (file) - fprintf(file, "/* %2u */\n", *typeformat_offset); - return write_nonsimple_pointer(file, var->attrs, type, - toplevel_param, - offset, typeformat_offset); - case TGT_INVALID: - break; - } - error("invalid type %s for var %s\n", type->name, var->name); - return 0; -} - -static int write_embedded_types(FILE *file, const attr_list_t *attrs, type_t *type, - const char *name, int write_ptr, unsigned int *tfsoff) -{ - int retmask = 0; - - switch (typegen_detect_type(type, attrs, TDT_ALL_TYPES)) - { - case TGT_USER_TYPE: - write_user_tfs(file, type, tfsoff); - break; - case TGT_STRING: - write_string_tfs(file, attrs, type, FALSE, name, tfsoff); - break; - case TGT_IFACE_POINTER: - write_ip_tfs(file, attrs, type, tfsoff); - break; - case TGT_POINTER: - { - type_t *ref = type_pointer_get_ref(type); - - if (!processed(ref) && type_get_type(ref) != TYPE_BASIC) - retmask |= write_embedded_types(file, NULL, ref, name, TRUE, tfsoff); - - if (write_ptr) - write_pointer_tfs(file, attrs, type, FALSE, tfsoff); - - retmask |= 1; - break; - } - case TGT_ARRAY: - /* conformant arrays and strings are handled specially */ - if (!is_conformant_array(type) || type_array_is_decl_as_ptr(type) ) - { - write_array_tfs(file, attrs, type, name, tfsoff); - if (is_conformant_array(type)) - retmask |= 1; - } - break; - case TGT_STRUCT: - if (!processed(type)) - write_struct_tfs(file, type, name, tfsoff); - break; - case TGT_UNION: - if (!processed(type)) - write_union_tfs(file, type, tfsoff); - break; - case TGT_ENUM: - case TGT_BASIC: - /* nothing to do */ - break; - case TGT_RANGE: - { expr_list_t *range_list = get_attrp(attrs, ATTR_RANGE); if (!range_list) range_list = get_aliaschain_attrp(type, ATTR_RANGE); - write_range_tfs(file, attrs, type, range_list, tfsoff); - break; - } - case TGT_CTXT_HANDLE: - case TGT_CTXT_HANDLE_POINTER: + return write_range_tfs(file, attrs, type, range_list, typeformat_offset); + } + case TGT_IFACE_POINTER: + return write_ip_tfs(file, attrs, type, typeformat_offset); + case TGT_POINTER: + if (processed(type_pointer_get_ref(type))) + offset = type_pointer_get_ref(type)->typestring_offset; + else + { + enum type_context ref_context; + if (context == TYPE_CONTEXT_TOPLEVELPARAM) + ref_context = TYPE_CONTEXT_PARAM; + else if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS) + ref_context = TYPE_CONTEXT_CONTAINER; + else + ref_context = context; + offset = write_type_tfs( + file, indent, attrs, type_pointer_get_ref(type), name, + ref_context, typeformat_offset); + } + if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS) + return 0; + else + return write_pointer_tfs(file, attrs, type, offset, + context == TYPE_CONTEXT_TOPLEVELPARAM, + typeformat_offset); case TGT_INVALID: - error("invalid type %s for var %s\n", type->name, name); - break; - } - - return retmask; + break; + } + error("invalid type %s for var %s\n", type->name, name); + return 0; +} + +static int write_embedded_types(FILE *file, const attr_list_t *attrs, type_t *type, + const char *name, int write_ptr, unsigned int *tfsoff) +{ + return write_type_tfs(file, 2, attrs, type, name, write_ptr ? TYPE_CONTEXT_CONTAINER : TYPE_CONTEXT_CONTAINER_NO_POINTERS, tfsoff); } static unsigned int process_tfs_stmts(FILE *file, const statement_list_t *stmts, @@ -2954,13 +2907,12 @@ if (!is_void(type_function_get_rettype(func->type))) { - var_t v = *func; - v.type = type_function_get_rettype(func->type); update_tfsoff(type_function_get_rettype(func->type), - write_typeformatstring_var( - file, 2, NULL, + write_type_tfs( + file, 2, func->attrs, type_function_get_rettype(func->type), - &v, FALSE, typeformat_offset), + func->name, TYPE_CONTEXT_PARAM, + typeformat_offset), file); } @@ -2969,9 +2921,10 @@ LIST_FOR_EACH_ENTRY( var, type_get_function_args(func->type), const var_t, entry ) update_tfsoff( var->type, - write_typeformatstring_var( - file, 2, func, var->type, var, - TRUE, typeformat_offset), + write_type_tfs( + file, 2, var->attrs, var->type, var->name, + TYPE_CONTEXT_TOPLEVELPARAM, + typeformat_offset), file); } } @@ -3371,15 +3324,10 @@ /* get fundamental type for the argument */ for (;;) { - if (is_attr(type->attrs, ATTR_WIREMARSHAL)) - break; - else if (is_attr(type->attrs, ATTR_CONTEXTHANDLE)) - break; - else if (type_is_alias(type)) - type = type_alias_get_aliasee(type); - else if (is_array(type)) - { - if (is_conformance_needed_for_phase(phase) && is_array(type)) + switch (typegen_detect_type(type, var->attrs, TDT_IGNORE_STRINGS|TDT_IGNORE_RANGES)) + { + case TGT_ARRAY: + if (is_conformance_needed_for_phase(phase)) { if (type_array_has_conformance(type)) { @@ -3396,18 +3344,16 @@ } } break; - } - else if (type_get_type(type) == TYPE_UNION) - { - if (is_conformance_needed_for_phase(phase)) + case TGT_UNION: + if (type_get_type(type) == TYPE_UNION && + is_conformance_needed_for_phase(phase)) { print_file(file, indent, "__frame->_StubMsg.MaxCount = (ULONG_PTR)"); write_expr(file, get_attrp(var->attrs, ATTR_SWITCHIS), 1, 1, NULL, NULL, local_var_prefix); fprintf(file, ";\n\n"); } break; - } - else if (type_get_type(type) == TYPE_INTERFACE || is_void(type)) + case TGT_IFACE_POINTER: { expr_t *iid; @@ -3419,10 +3365,21 @@ } break; } - else if (is_ptr(type)) + case TGT_POINTER: type = type_pointer_get_ref(type); - else + continue; + case TGT_INVALID: + case TGT_USER_TYPE: + case TGT_CTXT_HANDLE: + case TGT_CTXT_HANDLE_POINTER: + case TGT_STRING: + case TGT_BASIC: + case TGT_ENUM: + case TGT_STRUCT: + case TGT_RANGE: break; + } + break; } } @@ -3547,7 +3504,7 @@ case TGT_ARRAY: { unsigned char tc = get_array_fc(type); - const char *array_type = "FixedArray"; + const char *array_type = NULL; /* We already have the size_is expression since it's at the top level, but do checks for multidimensional conformant @@ -3556,19 +3513,25 @@ the return value. */ get_size_is_expr(type, var->name); - if (tc == RPC_FC_SMVARRAY || tc == RPC_FC_LGVARRAY) - { + switch (tc) + { + case RPC_FC_SMFARRAY: + case RPC_FC_LGFARRAY: + array_type = "FixedArray"; + break; + case RPC_FC_SMVARRAY: + case RPC_FC_LGVARRAY: array_type = "VaryingArray"; - } - else if (tc == RPC_FC_CARRAY) - { + break; + case RPC_FC_CARRAY: array_type = "ConformantArray"; - } - else if (tc == RPC_FC_CVARRAY || tc == RPC_FC_BOGUS_ARRAY) - { - array_type = (tc == RPC_FC_BOGUS_ARRAY - ? "ComplexArray" - : "ConformantVaryingArray"); + break; + case RPC_FC_CVARRAY: + array_type = "ConformantVaryingArray"; + break; + case RPC_FC_BOGUS_ARRAY: + array_type = "ComplexArray"; + break; } if (pointer_type != RPC_FC_RP) array_type = "Pointer"; @@ -4011,8 +3974,11 @@ print_file(file, 0, "static void __RPC_USER %s_%sExprEval_%04u(PMIDL_STUB_MESSAGE pStubMsg)\n", iface, name, callback_offset); print_file(file, 0, "{\n"); - print_file (file, 1, "%s *%s = (%s *)(pStubMsg->StackTop - %u);\n", - name, var_name, name, eval->baseoff); + print_file(file, 1, "%s", ""); + write_type_left(file, (type_t *)eval->structure, TRUE); + fprintf(file, " *%s = (", var_name); + write_type_left(file, (type_t *)eval->structure, TRUE); + fprintf(file, " *)(pStubMsg->StackTop - %u);\n", eval->baseoff); print_file(file, 1, "pStubMsg->Offset = 0;\n"); /* FIXME */ print_file(file, 1, "pStubMsg->MaxCount = (ULONG_PTR)"); write_expr(file, eval->expr, 1, 1, var_name_expr, eval->structure, ""); Modified: trunk/reactos/tools/widl/typegen.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/typegen.h?rev=4…
============================================================================== --- trunk/reactos/tools/widl/typegen.h [iso-8859-1] (original) +++ trunk/reactos/tools/widl/typegen.h [iso-8859-1] Sun Mar 21 13:47:24 2010 @@ -84,8 +84,6 @@ int decl_indirect(const type_t *t); void write_parameters_init(FILE *file, int indent, const var_t *func, const char *local_var_prefix); void print(FILE *file, int indent, const char *format, va_list ap); -int get_padding(const var_list_t *fields); -int is_user_type(const type_t *t); expr_t *get_size_is_expr(const type_t *t, const char *name); int is_full_pointer_function(const var_t *func); void write_full_pointer_init(FILE *file, int indent, const var_t *func, int is_server); Modified: trunk/reactos/tools/widl/widltypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/widltypes.h?rev…
============================================================================== --- trunk/reactos/tools/widl/widltypes.h [iso-8859-1] (original) +++ trunk/reactos/tools/widl/widltypes.h [iso-8859-1] Sun Mar 21 13:47:24 2010 @@ -44,15 +44,10 @@ #endif #define FALSE 0 -#define RPC_FC_MODULE 0xfc -#define RPC_FC_COCLASS 0xfd -#define RPC_FC_FUNCTION 0xfe - typedef struct _loc_info_t loc_info_t; typedef struct _attr_t attr_t; typedef struct _expr_t expr_t; typedef struct _type_t type_t; -typedef struct _typeref_t typeref_t; typedef struct _var_t var_t; typedef struct _declarator_t declarator_t; typedef struct _func_t func_t; @@ -529,8 +524,6 @@ int is_array(const type_t *t); int is_var_ptr(const var_t *v); int cant_be_null(const var_t *v); -int is_struct(unsigned char tc); -int is_union(unsigned char tc); #define tsENUM 1 #define tsSTRUCT 2
14 years, 9 months
1
0
0
0
[cwittich] 46293: [MSXML3] sync msxml3 to wine 1.1.41
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Mar 21 12:14:47 2010 New Revision: 46293 URL:
http://svn.reactos.org/svn/reactos?rev=46293&view=rev
Log: [MSXML3] sync msxml3 to wine 1.1.41 Modified: trunk/reactos/dll/win32/msxml3/domdoc.c Modified: trunk/reactos/dll/win32/msxml3/domdoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/domdoc.c?…
============================================================================== --- trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] Sun Mar 21 12:14:47 2010 @@ -1650,19 +1650,20 @@ static BOOL bstr_to_utf8( BSTR bstr, char **pstr, int *plen ) { - UINT len, blen = SysStringLen( bstr ); + UINT len; LPSTR str; - len = WideCharToMultiByte( CP_UTF8, 0, bstr, blen, NULL, 0, NULL, NULL ); + len = WideCharToMultiByte( CP_UTF8, 0, bstr, -1, NULL, 0, NULL, NULL ); str = heap_alloc( len ); if ( !str ) return FALSE; - WideCharToMultiByte( CP_UTF8, 0, bstr, blen, str, len, NULL, NULL ); + WideCharToMultiByte( CP_UTF8, 0, bstr, -1, str, len, NULL, NULL ); *plen = len; *pstr = str; return TRUE; } +/* don't rely on data to be in BSTR format, treat it as WCHAR string */ static HRESULT WINAPI domdoc_loadXML( IXMLDOMDocument2 *iface, BSTR bstrXML,
14 years, 9 months
1
0
0
0
[cwittich] 46292: [RPCRT4] partial rpcrt4 sync to wine 1.1.40 (fixes crashing cstub test)
by cwittich@svn.reactos.org
Author: cwittich Date: Sun Mar 21 11:53:17 2010 New Revision: 46292 URL:
http://svn.reactos.org/svn/reactos?rev=46292&view=rev
Log: [RPCRT4] partial rpcrt4 sync to wine 1.1.40 (fixes crashing cstub test) Modified: trunk/reactos/dll/win32/rpcrt4/cproxy.c trunk/reactos/dll/win32/rpcrt4/cpsf.c trunk/reactos/dll/win32/rpcrt4/cpsf.h trunk/reactos/dll/win32/rpcrt4/cstub.c trunk/reactos/dll/win32/rpcrt4/ndr_ole.c Modified: trunk/reactos/dll/win32/rpcrt4/cproxy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cproxy.c?…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/cproxy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/cproxy.c [iso-8859-1] Sun Mar 21 11:53:17 2010 @@ -2,6 +2,7 @@ * COM proxy implementation * * Copyright 2001 Ove KÃ¥ven, TransGaming Technologies + * Copyright 2009 Alexandre Julliard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,6 +21,9 @@ * TODO: Handle non-i386 architectures */ +#include "config.h" +#include "wine/port.h" + #include <stdarg.h> #define COBJMACROS @@ -36,8 +40,6 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); - -struct StublessThunk; /* I don't know what MS's std proxy structure looks like, so this probably doesn't match, but that shouldn't matter */ @@ -45,13 +47,13 @@ const IRpcProxyBufferVtbl *lpVtbl; LPVOID *PVtbl; LONG RefCount; - const MIDL_STUBLESS_PROXY_INFO *stubless; const IID* piid; LPUNKNOWN pUnkOuter; + IUnknown *base_object; /* must be at offset 0x10 from PVtbl */ + IRpcProxyBuffer *base_proxy; PCInterfaceName name; LPPSFACTORYBUFFER pPSFactory; LPRPCCHANNELBUFFER pChannel; - struct StublessThunk *thunks; } StdProxyImpl; static const IRpcProxyBufferVtbl StdProxy_Vtbl; @@ -62,66 +64,111 @@ #include "pshpack1.h" -struct StublessThunk { +struct thunk { BYTE push; DWORD index; - BYTE call; + BYTE jmp; LONG handler; - BYTE ret; - WORD bytes; - BYTE pad[3]; }; #include "poppack.h" -/* adjust the stack size since we don't use Windows's method */ -#define STACK_ADJUST sizeof(DWORD) - -#define FILL_STUBLESS(x,idx,stk) \ - x->push = 0x68; /* pushl [immediate] */ \ - x->index = (idx); \ - x->call = 0xe8; /* call [near] */ \ - x->handler = (char*)ObjectStubless - (char*)&x->ret; \ - x->ret = 0xc2; /* ret [immediate] */ \ - x->bytes = stk; \ - x->pad[0] = 0x8d; /* leal (%esi),%esi */ \ - x->pad[1] = 0x76; \ - x->pad[2] = 0x00; - -static HRESULT WINAPI ObjectStubless(DWORD index) -{ - char *args = (char*)(&index + 2); - LPVOID iface = *(LPVOID*)args; - - ICOM_THIS_MULTI(StdProxyImpl,PVtbl,iface); - - PFORMAT_STRING fs = This->stubless->ProcFormatString + This->stubless->FormatStringOffset[index]; - unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST; - TRACE("(%p)->(%d)([%d bytes]) ret=%08x\n", iface, index, bytes, *(DWORD*)(args+bytes)); - - return NdrClientCall2(This->stubless->pStubDesc, fs, args); +extern void call_stubless_func(void); +__ASM_GLOBAL_FUNC(call_stubless_func, + "pushl %esp\n\t" /* pointer to index */ + __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") + "call " __ASM_NAME("ObjectStubless") __ASM_STDCALL(4) "\n\t" + "popl %edx\n\t" /* args size */ + __ASM_CFI(".cfi_adjust_cfa_offset -4\n\t") + "movl (%esp),%ecx\n\t" /* return address */ + "addl %edx,%esp\n\t" + "jmp *%ecx" ); + +HRESULT WINAPI ObjectStubless(DWORD *args) +{ + DWORD index = args[0]; + void **iface = (void **)args[2]; + const void **vtbl = (const void **)*iface; + const MIDL_STUBLESS_PROXY_INFO *stubless = *(const MIDL_STUBLESS_PROXY_INFO **)(vtbl - 2); + const PFORMAT_STRING fs = stubless->ProcFormatString + stubless->FormatStringOffset[index]; + + /* store bytes to remove from stack */ + args[0] = *(const WORD*)(fs + 8); + TRACE("(%p)->(%d)([%d bytes]) ret=%08x\n", iface, index, args[0], args[1]); + + return NdrClientCall2(stubless->pStubDesc, fs, args + 2); +} + +#define BLOCK_SIZE 1024 +#define MAX_BLOCKS 64 /* 64k methods should be enough for anybody */ + +static const struct thunk *method_blocks[MAX_BLOCKS]; + +static const struct thunk *allocate_block( unsigned int num ) +{ + unsigned int i; + struct thunk *prev, *block; + + block = VirtualAlloc( NULL, BLOCK_SIZE * sizeof(*block), + MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE ); + if (!block) return NULL; + + for (i = 0; i < BLOCK_SIZE; i++) + { + block[i].push = 0x68; /* pushl */ + block[i].index = BLOCK_SIZE * num + i + 3; + block[i].jmp = 0xe9; /* jmp */ + block[i].handler = (char *)call_stubless_func - (char *)(&block[i].handler + 1); + } + VirtualProtect( block, BLOCK_SIZE * sizeof(*block), PAGE_EXECUTE_READ, NULL ); + prev = InterlockedCompareExchangePointer( (void **)&method_blocks[num], block, NULL ); + if (prev) /* someone beat us to it */ + { + VirtualFree( block, 0, MEM_RELEASE ); + block = prev; + } + return block; +} + +static BOOL fill_stubless_table( IUnknownVtbl *vtbl, DWORD num ) +{ + const void **entry = (const void **)(vtbl + 1); + DWORD i, j; + + if (num - 3 > BLOCK_SIZE * MAX_BLOCKS) + { + FIXME( "%u methods not supported\n", num ); + return FALSE; + } + for (i = 0; i < (num - 3 + BLOCK_SIZE - 1) / BLOCK_SIZE; i++) + { + const struct thunk *block = method_blocks[i]; + if (!block && !(block = allocate_block( i ))) return FALSE; + for (j = 0; j < BLOCK_SIZE && j < num - 3 - i * BLOCK_SIZE; j++, entry++) + if (*entry == (LPVOID)-1) *entry = &block[j]; + } + return TRUE; } #else /* __i386__ */ -/* can't do that on this arch */ -struct StublessThunk { int dummy; }; -#define FILL_STUBLESS(x,idx,stk) \ - ERR("stubless proxies are not supported on this architecture\n"); -#define STACK_ADJUST 0 +static BOOL fill_stubless_table( IUnknownVtbl *vtbl, DWORD num ) +{ + ERR("stubless proxies are not supported on this architecture\n"); + return FALSE; +} #endif /* __i386__ */ -HRESULT WINAPI StdProxy_Construct(REFIID riid, - LPUNKNOWN pUnkOuter, - const ProxyFileInfo *ProxyInfo, - int Index, - LPPSFACTORYBUFFER pPSFactory, - LPRPCPROXYBUFFER *ppProxy, - LPVOID *ppvObj) +HRESULT StdProxy_Construct(REFIID riid, + LPUNKNOWN pUnkOuter, + const ProxyFileInfo *ProxyInfo, + int Index, + LPPSFACTORYBUFFER pPSFactory, + LPRPCPROXYBUFFER *ppProxy, + LPVOID *ppvObj) { StdProxyImpl *This; - const MIDL_STUBLESS_PROXY_INFO *stubless = NULL; PCInterfaceName name = ProxyInfo->pNamesArray[Index]; CInterfaceProxyVtbl *vtbl = ProxyInfo->pProxyVtblList[Index]; @@ -129,13 +176,11 @@ /* TableVersion = 2 means it is the stubless version of CInterfaceProxyVtbl */ if (ProxyInfo->TableVersion > 1) { - stubless = *(const void **)vtbl; + ULONG count = ProxyInfo->pStubVtblList[Index]->header.DispatchTableCount; vtbl = (CInterfaceProxyVtbl *)((const void **)vtbl + 1); - TRACE("stubless=%p\n", stubless); - } - - TRACE("iid=%s\n", debugstr_guid(vtbl->header.piid)); - TRACE("vtbl=%p\n", vtbl->Vtbl); + TRACE("stubless vtbl %p: count=%d\n", vtbl->Vtbl, count ); + fill_stubless_table( (IUnknownVtbl *)vtbl->Vtbl, count ); + } if (!IsEqualGUID(vtbl->header.piid, riid)) { ERR("IID mismatch during proxy creation\n"); @@ -145,51 +190,37 @@ This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(StdProxyImpl)); if (!This) return E_OUTOFMEMORY; - if (stubless) { - CInterfaceStubVtbl *svtbl = ProxyInfo->pStubVtblList[Index]; - unsigned long i, count = svtbl->header.DispatchTableCount; - /* Maybe the original vtbl is just modified directly to point at - * ObjectStublessClientXXX thunks in real Windows, but I don't like it - */ - TRACE("stubless thunks: count=%ld\n", count); - This->thunks = HeapAlloc(GetProcessHeap(),0,sizeof(struct StublessThunk)*count); - This->PVtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPVOID)*count); - for (i=0; i<count; i++) { - struct StublessThunk *thunk = &This->thunks[i]; - if (vtbl->Vtbl[i] == (LPVOID)-1) { - PFORMAT_STRING fs = stubless->ProcFormatString + stubless->FormatStringOffset[i]; - unsigned bytes = *(const WORD*)(fs+8) - STACK_ADJUST; - TRACE("method %ld: stacksize=%d\n", i, bytes); - FILL_STUBLESS(thunk, i, bytes) - This->PVtbl[i] = thunk; - } - else { - memset(thunk, 0, sizeof(struct StublessThunk)); - This->PVtbl[i] = vtbl->Vtbl[i]; - } - } - } - else - This->PVtbl = vtbl->Vtbl; - + if (!pUnkOuter) pUnkOuter = (IUnknown *)This; This->lpVtbl = &StdProxy_Vtbl; + This->PVtbl = vtbl->Vtbl; /* one reference for the proxy */ This->RefCount = 1; - This->stubless = stubless; This->piid = vtbl->header.piid; + This->base_object = NULL; + This->base_proxy = NULL; This->pUnkOuter = pUnkOuter; This->name = name; This->pPSFactory = pPSFactory; This->pChannel = NULL; + + if(ProxyInfo->pDelegatedIIDs && ProxyInfo->pDelegatedIIDs[Index]) + { + HRESULT r = create_proxy( ProxyInfo->pDelegatedIIDs[Index], NULL, + &This->base_proxy, (void **)&This->base_object ); + if (FAILED(r)) + { + HeapFree( GetProcessHeap(), 0, This ); + return r; + } + } + *ppProxy = (LPRPCPROXYBUFFER)&This->lpVtbl; *ppvObj = &This->PVtbl; - /* if there is no outer unknown then the caller will control the lifetime - * of the proxy object through the proxy buffer, so no need to increment the - * ref count of the proxy object */ - if (pUnkOuter) - IUnknown_AddRef((IUnknown *)*ppvObj); + IUnknown_AddRef((IUnknown *)*ppvObj); IPSFactoryBuffer_AddRef(pPSFactory); + TRACE( "iid=%s this %p proxy %p obj %p vtbl %p base proxy %p base obj %p\n", + debugstr_guid(riid), This, *ppProxy, *ppvObj, This->PVtbl, This->base_proxy, This->base_object ); return S_OK; } @@ -200,11 +231,10 @@ if (This->pChannel) IRpcProxyBuffer_Disconnect(iface); + if (This->base_object) IUnknown_Release( This->base_object ); + if (This->base_proxy) IRpcProxyBuffer_Release( This->base_proxy ); + IPSFactoryBuffer_Release(This->pPSFactory); - if (This->thunks) { - HeapFree(GetProcessHeap(),0,This->PVtbl); - HeapFree(GetProcessHeap(),0,This->thunks); - } HeapFree(GetProcessHeap(),0,This); } @@ -259,6 +289,7 @@ This->pChannel = pChannel; IRpcChannelBuffer_AddRef(pChannel); + if (This->base_proxy) IRpcProxyBuffer_Connect( This->base_proxy, pChannel ); return S_OK; } @@ -266,6 +297,8 @@ { ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface); TRACE("(%p)->Disconnect()\n",This); + + if (This->base_proxy) IRpcProxyBuffer_Disconnect( This->base_proxy ); IRpcChannelBuffer_Release(This->pChannel); This->pChannel = NULL; Modified: trunk/reactos/dll/win32/rpcrt4/cpsf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cpsf.c?re…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/cpsf.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/cpsf.c [iso-8859-1] Sun Mar 21 11:53:17 2010 @@ -145,6 +145,41 @@ CStdPSFactory_CreateStub }; + +static void init_psfactory( CStdPSFactoryBuffer *psfac, const ProxyFileInfo **file_list ) +{ + DWORD i, j, k; + + psfac->lpVtbl = &CStdPSFactory_Vtbl; + psfac->RefCount = 0; + psfac->pProxyFileList = file_list; + for (i = 0; file_list[i]; i++) + { + const PCInterfaceProxyVtblList *proxies = file_list[i]->pProxyVtblList; + const PCInterfaceStubVtblList *stubs = file_list[i]->pStubVtblList; + + for (j = 0; j < file_list[i]->TableSize; j++) + { + /* FIXME: i think that different vtables should be copied for + * async interfaces */ + void * const *pSrcRpcStubVtbl = (void * const *)&CStdStubBuffer_Vtbl; + void **pRpcStubVtbl = (void **)&stubs[j]->Vtbl; + + if (file_list[i]->pDelegatedIIDs && file_list[i]->pDelegatedIIDs[j]) + { + void **vtbl = proxies[j]->Vtbl; + if (file_list[i]->TableVersion > 1) vtbl++; + fill_delegated_proxy_table( (IUnknownVtbl *)vtbl, stubs[j]->header.DispatchTableCount ); + pSrcRpcStubVtbl = (void * const *)&CStdStubBuffer_Delegating_Vtbl; + } + + for (k = 0; k < sizeof(IRpcStubBufferVtbl)/sizeof(void *); k++) + if (!pRpcStubVtbl[k]) pRpcStubVtbl[k] = pSrcRpcStubVtbl[k]; + } + } +} + + /*********************************************************************** * NdrDllGetClassObject [RPCRT4.@] */ @@ -158,35 +193,8 @@ pPSFactoryBuffer); *ppv = NULL; - if (!pPSFactoryBuffer->lpVtbl) { - const ProxyFileInfo **pProxyFileList2; - DWORD max_delegating_vtbl_size = 0; - pPSFactoryBuffer->lpVtbl = &CStdPSFactory_Vtbl; - pPSFactoryBuffer->RefCount = 0; - pPSFactoryBuffer->pProxyFileList = pProxyFileList; - for (pProxyFileList2 = pProxyFileList; *pProxyFileList2; pProxyFileList2++) { - int i; - for (i = 0; i < (*pProxyFileList2)->TableSize; i++) { - /* FIXME: i think that different vtables should be copied for - * async interfaces */ - void * const *pSrcRpcStubVtbl = (void * const *)&CStdStubBuffer_Vtbl; - void **pRpcStubVtbl = (void **)&(*pProxyFileList2)->pStubVtblList[i]->Vtbl; - unsigned int j; - - if ((*pProxyFileList2)->pDelegatedIIDs && (*pProxyFileList2)->pDelegatedIIDs[i]) { - pSrcRpcStubVtbl = (void * const *)&CStdStubBuffer_Delegating_Vtbl; - if ((*pProxyFileList2)->pStubVtblList[i]->header.DispatchTableCount > max_delegating_vtbl_size) - max_delegating_vtbl_size = (*pProxyFileList2)->pStubVtblList[i]->header.DispatchTableCount; - } - - for (j = 0; j < sizeof(IRpcStubBufferVtbl)/sizeof(void *); j++) - if (!pRpcStubVtbl[j]) - pRpcStubVtbl[j] = pSrcRpcStubVtbl[j]; - } - } - if(max_delegating_vtbl_size > 0) - create_delegating_vtbl(max_delegating_vtbl_size); - } + if (!pPSFactoryBuffer->lpVtbl) init_psfactory( pPSFactoryBuffer, pProxyFileList ); + if (pclsid && IsEqualGUID(rclsid, pclsid)) return IPSFactoryBuffer_QueryInterface((LPPSFACTORYBUFFER)pPSFactoryBuffer, iid, ppv); else { @@ -207,7 +215,7 @@ */ HRESULT WINAPI NdrDllCanUnloadNow(CStdPSFactoryBuffer *pPSFactoryBuffer) { - return !(pPSFactoryBuffer->RefCount); + return pPSFactoryBuffer->RefCount != 0 ? S_FALSE : S_OK; } @@ -266,7 +274,7 @@ if (len && len < sizeof(module)) { TRACE("registering CLSID %s => %s\n", debugstr_w(clsid), debugstr_w(module)); if (RegCreateKeyW(HKEY_CLASSES_ROOT, keyname, &key) == ERROR_SUCCESS) { - RegSetValueExW(subkey, NULL, 0, REG_SZ, (const BYTE *)psfactoryW, sizeof(psfactoryW)); + RegSetValueExW(key, NULL, 0, REG_SZ, (const BYTE *)psfactoryW, sizeof(psfactoryW)); if (RegCreateKeyW(key, inprocserverW, &subkey) == ERROR_SUCCESS) { RegSetValueExW(subkey, NULL, 0, REG_SZ, (LPBYTE)module, (strlenW(module)+1)*sizeof(WCHAR)); RegSetValueExW(subkey, threadingmodelW, 0, REG_SZ, (const BYTE *)bothW, sizeof(bothW)); Modified: trunk/reactos/dll/win32/rpcrt4/cpsf.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cpsf.h?re…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/cpsf.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/cpsf.h [iso-8859-1] Sun Mar 21 11:53:17 2010 @@ -21,36 +21,25 @@ #ifndef __WINE_CPSF_H #define __WINE_CPSF_H -HRESULT WINAPI StdProxy_Construct(REFIID riid, - LPUNKNOWN pUnkOuter, - const ProxyFileInfo *ProxyInfo, - int Index, - LPPSFACTORYBUFFER pPSFactory, - LPRPCPROXYBUFFER *ppProxy, - LPVOID *ppvObj); +HRESULT StdProxy_Construct(REFIID riid, LPUNKNOWN pUnkOuter, const ProxyFileInfo *ProxyInfo, + int Index, LPPSFACTORYBUFFER pPSFactory, LPRPCPROXYBUFFER *ppProxy, + LPVOID *ppvObj); -HRESULT WINAPI CStdStubBuffer_Construct(REFIID riid, - LPUNKNOWN pUnkServer, - PCInterfaceName name, - CInterfaceStubVtbl *vtbl, - LPPSFACTORYBUFFER pPSFactory, - LPRPCSTUBBUFFER *ppStub); +HRESULT CStdStubBuffer_Construct(REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, + CInterfaceStubVtbl *vtbl, LPPSFACTORYBUFFER pPSFactory, + LPRPCSTUBBUFFER *ppStub); -HRESULT WINAPI CStdStubBuffer_Delegating_Construct(REFIID riid, - LPUNKNOWN pUnkServer, - PCInterfaceName name, - CInterfaceStubVtbl *vtbl, - REFIID delegating_iid, - LPPSFACTORYBUFFER pPSFactory, - LPRPCSTUBBUFFER *ppStub); +HRESULT CStdStubBuffer_Delegating_Construct(REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, + CInterfaceStubVtbl *vtbl, REFIID delegating_iid, + LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub); const MIDL_SERVER_INFO *CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface); const IRpcStubBufferVtbl CStdStubBuffer_Vtbl; const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl; -void create_delegating_vtbl(DWORD num_methods); - +BOOL fill_delegated_proxy_table(IUnknownVtbl *vtbl, DWORD num); +HRESULT create_proxy(REFIID iid, IUnknown *pUnkOuter, IRpcProxyBuffer **pproxy, void **ppv); HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub); #endif /* __WINE_CPSF_H */ Modified: trunk/reactos/dll/win32/rpcrt4/cstub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/cstub.c?r…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/cstub.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/cstub.c [iso-8859-1] Sun Mar 21 11:53:17 2010 @@ -2,6 +2,7 @@ * COM stub (CStdStubBuffer) implementation * * Copyright 2001 Ove KÃ¥ven, TransGaming Technologies + * Copyright 2009 Alexandre Julliard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -61,12 +62,12 @@ return (cstdstubbuffer_delegating_t*)((char *)iface - FIELD_OFFSET(cstdstubbuffer_delegating_t, stub_buffer)); } -HRESULT WINAPI CStdStubBuffer_Construct(REFIID riid, - LPUNKNOWN pUnkServer, - PCInterfaceName name, - CInterfaceStubVtbl *vtbl, - LPPSFACTORYBUFFER pPSFactory, - LPRPCSTUBBUFFER *ppStub) +HRESULT CStdStubBuffer_Construct(REFIID riid, + LPUNKNOWN pUnkServer, + PCInterfaceName name, + CInterfaceStubVtbl *vtbl, + LPPSFACTORYBUFFER pPSFactory, + LPRPCSTUBBUFFER *ppStub) { CStdStubBuffer *This; IUnknown *pvServer; @@ -113,20 +114,16 @@ { DWORD ref; DWORD size; - void **methods; IUnknownVtbl vtbl; /* remaining entries in vtbl */ } ref_counted_vtbl; -static struct -{ - ref_counted_vtbl *table; -} current_vtbl; +static ref_counted_vtbl *current_vtbl; static HRESULT WINAPI delegating_QueryInterface(IUnknown *pUnk, REFIID iid, void **ppv) { - *ppv = (void *)pUnk; + *ppv = pUnk; return S_OK; } @@ -161,87 +158,137 @@ } vtbl_method_t; #include "poppack.h" -static void fill_table(IUnknownVtbl *vtbl, void **methods, DWORD num) -{ - vtbl_method_t *method; - void **entry; - DWORD i; - +#define BLOCK_SIZE 1024 +#define MAX_BLOCKS 64 /* 64k methods should be enough for anybody */ + +static const vtbl_method_t *method_blocks[MAX_BLOCKS]; + +static const vtbl_method_t *allocate_block( unsigned int num ) +{ + unsigned int i; + vtbl_method_t *prev, *block; + + block = VirtualAlloc( NULL, BLOCK_SIZE * sizeof(*block), + MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE ); + if (!block) return NULL; + + for (i = 0; i < BLOCK_SIZE; i++) + { + block[i].mov1 = 0x0424448b; + block[i].mov2 = 0x408b; + block[i].sixteen = 0x10; + block[i].mov3 = 0x04244489; + block[i].mov4 = 0x008b; + block[i].mov5 = 0x808b; + block[i].offset = (BLOCK_SIZE * num + i + 3) << 2; + block[i].jmp = 0xe0ff; + block[i].pad[0] = 0x8d; + block[i].pad[1] = 0x76; + block[i].pad[2] = 0x00; + } + VirtualProtect( block, BLOCK_SIZE * sizeof(*block), PAGE_EXECUTE_READ, NULL ); + prev = InterlockedCompareExchangePointer( (void **)&method_blocks[num], block, NULL ); + if (prev) /* someone beat us to it */ + { + VirtualFree( block, 0, MEM_RELEASE ); + block = prev; + } + return block; +} + +static BOOL fill_delegated_stub_table(IUnknownVtbl *vtbl, DWORD num) +{ + const void **entry = (const void **)(vtbl + 1); + DWORD i, j; + + if (num - 3 > BLOCK_SIZE * MAX_BLOCKS) + { + FIXME( "%u methods not supported\n", num ); + return FALSE; + } vtbl->QueryInterface = delegating_QueryInterface; vtbl->AddRef = delegating_AddRef; vtbl->Release = delegating_Release; - - method = (vtbl_method_t*)methods; - entry = (void**)(vtbl + 1); - - for(i = 3; i < num; i++) - { - *entry = method; - method->mov1 = 0x0424448b; - method->mov2 = 0x408b; - method->sixteen = 0x10; - method->mov3 = 0x04244489; - method->mov4 = 0x008b; - method->mov5 = 0x808b; - method->offset = i << 2; - method->jmp = 0xe0ff; - method->pad[0] = 0x8d; - method->pad[1] = 0x76; - method->pad[2] = 0x00; - - method++; - entry++; - } + for (i = 0; i < (num - 3 + BLOCK_SIZE - 1) / BLOCK_SIZE; i++) + { + const vtbl_method_t *block = method_blocks[i]; + if (!block && !(block = allocate_block( i ))) return FALSE; + for (j = 0; j < BLOCK_SIZE && j < num - 3 - i * BLOCK_SIZE; j++) *entry++ = &block[j]; + } + return TRUE; +} + +BOOL fill_delegated_proxy_table(IUnknownVtbl *vtbl, DWORD num) +{ + const void **entry = (const void **)(vtbl + 1); + DWORD i, j; + + if (num - 3 > BLOCK_SIZE * MAX_BLOCKS) + { + FIXME( "%u methods not supported\n", num ); + return FALSE; + } + vtbl->QueryInterface = IUnknown_QueryInterface_Proxy; + vtbl->AddRef = IUnknown_AddRef_Proxy; + vtbl->Release = IUnknown_Release_Proxy; + for (i = 0; i < (num - 3 + BLOCK_SIZE - 1) / BLOCK_SIZE; i++) + { + const vtbl_method_t *block = method_blocks[i]; + if (!block && !(block = allocate_block( i ))) return FALSE; + for (j = 0; j < BLOCK_SIZE && j < num - 3 - i * BLOCK_SIZE; j++, entry++) + if (!*entry) *entry = &block[j]; + } + return TRUE; } #else /* __i386__ */ -typedef struct {int dummy;} vtbl_method_t; -static void fill_table(IUnknownVtbl *vtbl, void **methods, DWORD num) +static BOOL fill_delegated_stub_table(IUnknownVtbl *vtbl, DWORD num) { ERR("delegated stubs are not supported on this architecture\n"); + return FALSE; +} + +BOOL fill_delegated_proxy_table(IUnknownVtbl *vtbl, DWORD num) +{ + ERR("delegated proxies are not supported on this architecture\n"); + return FALSE; } #endif /* __i386__ */ -void create_delegating_vtbl(DWORD num_methods) -{ - TRACE("%d\n", num_methods); - if(num_methods <= 3) - { - ERR("should have more than %d methods\n", num_methods); - return; - } +static IUnknownVtbl *get_delegating_vtbl(DWORD num_methods) +{ + IUnknownVtbl *ret; + + if (num_methods < 256) num_methods = 256; /* avoid frequent reallocations */ EnterCriticalSection(&delegating_vtbl_section); - if(!current_vtbl.table || num_methods > current_vtbl.table->size) - { - DWORD size; - DWORD old_protect; - if(current_vtbl.table && current_vtbl.table->ref == 0) + + if(!current_vtbl || num_methods > current_vtbl->size) + { + ref_counted_vtbl *table = HeapAlloc(GetProcessHeap(), 0, + FIELD_OFFSET(ref_counted_vtbl, vtbl) + num_methods * sizeof(void*)); + if (!table) + { + LeaveCriticalSection(&delegating_vtbl_section); + return NULL; + } + + table->ref = 0; + table->size = num_methods; + fill_delegated_stub_table(&table->vtbl, num_methods); + + if (current_vtbl && current_vtbl->ref == 0) { TRACE("freeing old table\n"); - VirtualFree(current_vtbl.table->methods, 0, MEM_RELEASE); - HeapFree(GetProcessHeap(), 0, current_vtbl.table); + HeapFree(GetProcessHeap(), 0, current_vtbl); } - size = (num_methods - 3) * sizeof(vtbl_method_t); - current_vtbl.table = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(ref_counted_vtbl, vtbl) + num_methods * sizeof(void*)); - current_vtbl.table->ref = 0; - current_vtbl.table->size = num_methods; - current_vtbl.table->methods = VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); - fill_table(¤t_vtbl.table->vtbl, current_vtbl.table->methods, num_methods); - VirtualProtect(current_vtbl.table->methods, size, PAGE_EXECUTE_READ, &old_protect); - } - LeaveCriticalSection(&delegating_vtbl_section); -} - -static IUnknownVtbl *get_delegating_vtbl(void) -{ - IUnknownVtbl *ret; - - EnterCriticalSection(&delegating_vtbl_section); - current_vtbl.table->ref++; - ret = ¤t_vtbl.table->vtbl; + current_vtbl = table; + } + + current_vtbl->ref++; + ret = ¤t_vtbl->vtbl; LeaveCriticalSection(&delegating_vtbl_section); return ret; } @@ -253,22 +300,21 @@ EnterCriticalSection(&delegating_vtbl_section); table->ref--; TRACE("ref now %d\n", table->ref); - if(table->ref == 0 && table != current_vtbl.table) + if(table->ref == 0 && table != current_vtbl) { TRACE("... and we're not current so free'ing\n"); - VirtualFree(current_vtbl.table->methods, 0, MEM_RELEASE); HeapFree(GetProcessHeap(), 0, table); } LeaveCriticalSection(&delegating_vtbl_section); } -HRESULT WINAPI CStdStubBuffer_Delegating_Construct(REFIID riid, - LPUNKNOWN pUnkServer, - PCInterfaceName name, - CInterfaceStubVtbl *vtbl, - REFIID delegating_iid, - LPPSFACTORYBUFFER pPSFactory, - LPRPCSTUBBUFFER *ppStub) +HRESULT CStdStubBuffer_Delegating_Construct(REFIID riid, + LPUNKNOWN pUnkServer, + PCInterfaceName name, + CInterfaceStubVtbl *vtbl, + REFIID delegating_iid, + LPPSFACTORYBUFFER pPSFactory, + LPRPCSTUBBUFFER *ppStub) { cstdstubbuffer_delegating_t *This; IUnknown *pvServer; @@ -294,7 +340,7 @@ return E_OUTOFMEMORY; } - This->base_obj = get_delegating_vtbl(); + This->base_obj = get_delegating_vtbl( vtbl->header.DispatchTableCount ); r = create_stub(delegating_iid, (IUnknown*)&This->base_obj, &This->base_stub); if(FAILED(r)) { Modified: trunk/reactos/dll/win32/rpcrt4/ndr_ole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/ndr_ole.c…
============================================================================== --- trunk/reactos/dll/win32/rpcrt4/ndr_ole.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/rpcrt4/ndr_ole.c [iso-8859-1] Sun Mar 21 11:53:17 2010 @@ -370,10 +370,10 @@ } /*********************************************************************** - * Helper function to create a stub. - * This probably looks very much like NdrpCreateStub. - */ -HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub) + * Helper function to create a proxy. + * Probably similar to NdrpCreateProxy. + */ +HRESULT create_proxy(REFIID iid, IUnknown *pUnkOuter, IRpcProxyBuffer **pproxy, void **ppv) { CLSID clsid; IPSFactoryBuffer *psfac; @@ -387,8 +387,32 @@ r = COM_GetClassObject( &clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IPSFactoryBuffer, (void**)&psfac ); if(FAILED(r)) return r; - r = IPSFactoryBuffer_CreateStub(psfac, iid, pUnk, ppstub); + r = IPSFactoryBuffer_CreateProxy(psfac, pUnkOuter, iid, pproxy, ppv); IPSFactoryBuffer_Release(psfac); return r; } + +/*********************************************************************** + * Helper function to create a stub. + * This probably looks very much like NdrpCreateStub. + */ +HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub) +{ + CLSID clsid; + IPSFactoryBuffer *psfac; + HRESULT r; + + if(!LoadCOM()) return E_FAIL; + + r = COM_GetPSClsid( iid, &clsid ); + if(FAILED(r)) return r; + + r = COM_GetClassObject( &clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IPSFactoryBuffer, (void**)&psfac ); + if(FAILED(r)) return r; + + r = IPSFactoryBuffer_CreateStub(psfac, iid, pUnk, ppstub); + + IPSFactoryBuffer_Release(psfac); + return r; +}
14 years, 9 months
1
0
0
0
[sir_richard] 46291: [CMBATT]: Implement CmBattGetBatteryStatus. See ACPI Specification 4.0B (10.2 Control Method Batteries, P.383).
by sir_richard@svn.reactos.org
Author: sir_richard Date: Sun Mar 21 04:14:12 2010 New Revision: 46291 URL:
http://svn.reactos.org/svn/reactos?rev=46291&view=rev
Log: [CMBATT]: Implement CmBattGetBatteryStatus. See ACPI Specification 4.0B (10.2 Control Method Batteries, P.383). Modified: trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.c trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.h Modified: trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/cmbatt/cm…
============================================================================== --- trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.c [iso-8859-1] Sun Mar 21 04:14:12 2010 @@ -18,6 +18,7 @@ UNICODE_STRING GlobalRegistryPath; KTIMER CmBattWakeDpcTimerObject; KDPC CmBattWakeDpcObject; +PDEVICE_OBJECT AcAdapterPdo; /* FUNCTIONS ******************************************************************/ @@ -182,11 +183,220 @@ NTSTATUS NTAPI -CmBattGetBatteryStatus(PCMBATT_DEVICE_EXTENSION DeviceExtension, - ULONG BatteryTag) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; +CmBattGetBatteryStatus(IN PCMBATT_DEVICE_EXTENSION DeviceExtension, + IN ULONG Tag) +{ + ULONG PsrData = 0; + NTSTATUS Status; + ULONG BstState; + ULONG DesignVoltage, PresentRate, RemainingCapacity; + PAGED_CODE(); + if (CmBattDebug & CMBATT_GENERIC_INFO) + DbgPrint("CmBattGetBatteryStatus - CmBatt (%08x) Tag (%d)\n", DeviceExtension, Tag); + + /* Validate ACPI data */ + Status = CmBattVerifyStaticInfo(DeviceExtension, Tag); + if (!NT_SUCCESS(Status)) return Status; + + /* Check for delayed status notifications */ + if (DeviceExtension->DelayNotification) + { + /* Process them now and don't do any other work */ + CmBattNotifyHandler(DeviceExtension, ACPI_BATT_NOTIFY_STATUS); + return Status; + } + + /* Get _BST from ACPI */ + Status = CmBattGetBstData(DeviceExtension, &DeviceExtension->BstData); + if (!NT_SUCCESS(Status)) + { + /* Fail */ + InterlockedExchange(&DeviceExtension->ArLockValue, 0); + return Status; + } + + /* Clear current BST information */ + DeviceExtension->State = 0; + DeviceExtension->RemainingCapacity = 0; + DeviceExtension->PresentVoltage = 0; + DeviceExtension->Rate = 0; + + /* Get battery state */ + BstState = DeviceExtension->BstData.State; + + /* Is the battery both charging and discharging? */ + if ((BstState & ACPI_BATT_STAT_DISCHARG) && (BstState & ACPI_BATT_STAT_CHARGING) && + (CmBattDebug & (CMBATT_ACPI_WARNING | CMBATT_GENERIC_WARNING))) + DbgPrint("************************ ACPI BIOS BUG ********************\n* " + "CmBattGetBatteryStatus: Invalid state: _BST method returned 0x%08x for Battery State.\n" + "* One battery cannot be charging and discharging at the same time.\n", + BstState); + + /* Is the battery discharging? */ + if (BstState & ACPI_BATT_STAT_DISCHARG) + { + /* Set power state and check if it just started discharging now */ + DeviceExtension->State |= BATTERY_DISCHARGING; + if (!(DeviceExtension->State & ACPI_BATT_STAT_DISCHARG)) + { + /* Remember the time when the state changed */ + DeviceExtension->InterruptTime = KeQueryInterruptTime(); + } + } + else if (BstState & ACPI_BATT_STAT_CHARGING) + { + /* Battery is charging, update power state */ + DeviceExtension->State |= (BATTERY_CHARGING | BATTERY_POWER_ON_LINE); + } + + /* Is the battery in a critical state? */ + if (BstState & ACPI_BATT_STAT_CRITICAL) DeviceExtension->State |= BATTERY_CRITICAL; + + /* Read the voltage data */ + DeviceExtension->PresentVoltage = DeviceExtension->BstData.PresentVoltage; + + /* Check if we have an A/C adapter */ + if (AcAdapterPdo) + { + /* Query information on it */ + CmBattGetPsrData(AcAdapterPdo, &PsrData); + } + else + { + /* Otherwise, check if the battery is charging */ + if (BstState & ACPI_BATT_STAT_CHARGING) + { + /* Then we'll assume there's a charger */ + PsrData = 1; + } + else + { + /* Assume no charger */ + PsrData = 0; + } + } + + /* Is there a charger? */ + if (PsrData) + { + /* Set the power state flag to reflect this */ + DeviceExtension->State |= BATTERY_POWER_ON_LINE; + if (CmBattDebug & (CMBATT_GENERIC_INFO | CMBATT_GENERIC_STATUS)) + DbgPrint("CmBattGetBatteryStatus: AC adapter is connected\n"); + } + else if (CmBattDebug & (CMBATT_GENERIC_INFO | CMBATT_GENERIC_STATUS)) + { + DbgPrint("CmBattGetBatteryStatus: AC adapter is NOT connected\n"); + } + + /* Get some data we'll need */ + DesignVoltage = DeviceExtension->BifData.DesignVoltage; + PresentRate = DeviceExtension->BstData.PresentRate; + RemainingCapacity = DeviceExtension->BstData.RemainingCapacity; + + /* Check if we have battery data in Watts instead of Amps */ + if (DeviceExtension->BifData.PowerUnit == ACPI_BATT_POWER_UNIT_WATTS) + { + /* Get the data from the BST */ + DeviceExtension->RemainingCapacity = RemainingCapacity; + DeviceExtension->Rate = PresentRate; + + /* Check if the rate is invalid */ + if (PresentRate > CM_MAX_VALUE) + { + /* Set an unknown rate and don't touch the old value */ + DeviceExtension->Rate = BATTERY_UNKNOWN_RATE; + if ((PresentRate != CM_UNKNOWN_VALUE) && (CmBattDebug & CMBATT_ACPI_WARNING)) + { + DbgPrint("CmBattGetBatteryStatus - Rate is greater than CM_MAX_VALUE\n"); + DbgPrint("---------------------- PresentRate = 0x%08x\n", PresentRate); + } + } + } + else if ((DesignVoltage != CM_UNKNOWN_VALUE) && (DesignVoltage)) + { + /* We have voltage data, what about capacity? */ + if (RemainingCapacity == CM_UNKNOWN_VALUE) + { + /* Unable to calculate it */ + DeviceExtension->RemainingCapacity = BATTERY_UNKNOWN_CAPACITY; + if (CmBattDebug & CMBATT_ACPI_WARNING) + { + DbgPrint("CmBattGetBatteryStatus - Can't calculate RemainingCapacity \n"); + DbgPrint("---------------------- RemainingCapacity = CM_UNKNOWN_VALUE\n"); + } + } + else + { + /* Compute the capacity with the information we have */ + DeviceExtension->RemainingCapacity = (DesignVoltage * RemainingCapacity + 500) / 1000; + } + + /* Check if we have a rate */ + if (PresentRate != CM_UNKNOWN_VALUE) + { + /* Make sure the rate isn't too large */ + if (PresentRate > (-500 / DesignVoltage)) + { + /* It is, so set unknown state */ + DeviceExtension->Rate = BATTERY_UNKNOWN_RATE; + if (CmBattDebug & CMBATT_ACPI_WARNING) + { + DbgPrint("CmBattGetBatteryStatus - Can't calculate Rate \n"); + DbgPrint("---------------------- Overflow: PresentRate = 0x%08x\n", PresentRate); + } + } + + /* Compute the rate */ + DeviceExtension->Rate = (PresentRate * DesignVoltage + 500) / 1000; + } + else + { + /* We don't have a rate, so set unknown value */ + DeviceExtension->Rate = BATTERY_UNKNOWN_RATE; + if (CmBattDebug & CMBATT_ACPI_WARNING) + { + DbgPrint("CmBattGetBatteryStatus - Can't calculate Rate \n"); + DbgPrint("---------------------- Present Rate = CM_UNKNOWN_VALUE\n"); + } + } + } + else + { + /* We have no rate, and no capacity, set unknown values */ + DeviceExtension->Rate = BATTERY_UNKNOWN_RATE; + DeviceExtension->RemainingCapacity = BATTERY_UNKNOWN_CAPACITY; + if (CmBattDebug & CMBATT_ACPI_WARNING) + { + DbgPrint("CmBattGetBatteryStatus - Can't calculate RemainingCapacity and Rate \n"); + DbgPrint("---------------------- DesignVoltage = 0x%08x\n", DesignVoltage); + } + } + + /* Check if we have an unknown rate */ + if (DeviceExtension->Rate == BATTERY_UNKNOWN_RATE) + { + /* The battery is discharging but we don't know by how much... this is bad! */ + if ((BstState & ACPI_BATT_STAT_DISCHARG) && + (CmBattDebug & (CMBATT_ACPI_WARNING | CMBATT_GENERIC_WARNING))) + DbgPrint("CmBattGetBatteryStatus: battery rate is unkown when battery is not charging!\n"); + } + else if (DeviceExtension->State & BATTERY_DISCHARGING) + { + /* The battery is discharging, so treat the rate as a negative rate */ + DeviceExtension->Rate = -DeviceExtension->Rate; + } + else if (!(DeviceExtension->State & BATTERY_CHARGING) && (DeviceExtension->Rate)) + { + /* We are not charging, not discharging, but have a rate? Ignore it! */ + if (CmBattDebug & CMBATT_GENERIC_WARNING) + DbgPrint("CmBattGetBatteryStatus: battery is not charging or discharging, but rate = %x\n", + DeviceExtension->Rate); + DeviceExtension->Rate = 0; + } + + /* Done */ + return STATUS_SUCCESS; } NTSTATUS Modified: trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/cmbatt/cm…
============================================================================== --- trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.h [iso-8859-1] Sun Mar 21 04:14:12 2010 @@ -29,11 +29,15 @@ CmBattBattery } CMBATT_EXTENSION_TYPE; +#define ACPI_BATT_NOTIFY_STATUS 0x80 +#define ACPI_BATT_NOTIFY_INFO 0x81 + #define ACPI_BATT_STAT_DISCHARG 0x0001 #define ACPI_BATT_STAT_CHARGING 0x0002 #define ACPI_BATT_STAT_CRITICAL 0x0004 -#define ACPI_BATT_STAT_NOT_PRESENT 0x0007 -#define ACPI_BATT_STAT_MAX 0x0007 + +#define CM_MAX_VALUE 0x7FFFFFFF +#define CM_UNKNOWN_VALUE 0xFFFFFFFF typedef struct _ACPI_BST_DATA { @@ -42,6 +46,9 @@ ULONG RemainingCapacity; ULONG PresentVoltage; } ACPI_BST_DATA, *PACPI_BST_DATA; + +#define ACPI_BATT_POWER_UNIT_WATTS 0x0 +#define ACPI_BATT_POWER_UNIT_AMPS 0x1 typedef struct _ACPI_BIF_DATA { @@ -82,8 +89,8 @@ BOOLEAN DelayedArFlag; PVOID ClassData; BOOLEAN Started; - BOOLEAN NotifySent; - ULONG ArLock; + BOOLEAN DelayNotification; + LONG ArLockValue; ULONG TagData; ULONG Tag; ULONG ModelNumberLength; @@ -135,5 +142,19 @@ PDEVICE_OBJECT DeviceObject, PIRP Irp ); - + +NTSTATUS +NTAPI +CmBattGetBstData( + PCMBATT_DEVICE_EXTENSION DeviceExtension, + PACPI_BST_DATA BstData +); + +NTSTATUS +NTAPI +CmBattGetPsrData( + PDEVICE_OBJECT DeviceObject, + PULONG PsrData +); + /* EOF */
14 years, 9 months
1
0
0
0
[akhaldi] 46290: [DDK] - Fix PIO_CSQ_INSERT_IRP_EX redefinition. [NTDDK] - Remove a couple of duplicate definitions. [XDK] - Move several definitions to their appropriate places. - Add COMPUTE_PAGES_SPANNED, NODE_REQUIREMENT, MM_ANY_NODE_OK, PNTFS_DEREF_EXPORTED_SECURITY_DESCRIPTOR, PsWrapApcWow64Thread, IRP_MN_DEVICE_ENUMERATED, USE_DMA_MACROS, NO_LEGACY_DRIVERS, FO_FLAGS_VALID_ONLY_DURING_CREATE, LOADER_PARTITION_INFORMATION_EX, BOOTDISK_INFORMATION_LITE, IO_CSQ_INSERT_IRP_EX, STATUS_CONTINUE_
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Mar 21 00:01:57 2010 New Revision: 46290 URL:
http://svn.reactos.org/svn/reactos?rev=46290&view=rev
Log: [DDK] - Fix PIO_CSQ_INSERT_IRP_EX redefinition. [NTDDK] - Remove a couple of duplicate definitions. [XDK] - Move several definitions to their appropriate places. - Add COMPUTE_PAGES_SPANNED, NODE_REQUIREMENT, MM_ANY_NODE_OK, PNTFS_DEREF_EXPORTED_SECURITY_DESCRIPTOR, PsWrapApcWow64Thread, IRP_MN_DEVICE_ENUMERATED, USE_DMA_MACROS, NO_LEGACY_DRIVERS, FO_FLAGS_VALID_ONLY_DURING_CREATE, LOADER_PARTITION_INFORMATION_EX, BOOTDISK_INFORMATION_LITE, IO_CSQ_INSERT_IRP_EX, STATUS_CONTINUE_COMPLETION and several missing Ex*, REG_*, Cm*, Mm*, SL_*, Io*, IO_*, CONNECT_*, WDM_* and WMI* definitions. - Update ExGetCurrentResourceThread and PADAPTER_OBJECT. - Group some related definitions. [WDM] - Update wdm.h to reflect XDK changes. Modified: branches/header-work/include/ddk/csq.h branches/header-work/include/ddk/ntddk.h branches/header-work/include/ddk/wdm.h branches/header-work/include/xdk/cmfuncs.h branches/header-work/include/xdk/cmtypes.h branches/header-work/include/xdk/exfuncs.h branches/header-work/include/xdk/extypes.h branches/header-work/include/xdk/iofuncs.h branches/header-work/include/xdk/iotypes.h branches/header-work/include/xdk/mmfuncs.h branches/header-work/include/xdk/mmtypes.h branches/header-work/include/xdk/psfuncs.h branches/header-work/include/xdk/setypes.h branches/header-work/include/xdk/wdm.template.h Modified: branches/header-work/include/ddk/csq.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/csq.h?r…
============================================================================== --- branches/header-work/include/ddk/csq.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/csq.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -229,9 +229,11 @@ } * */ +#ifndef IO_TYPE_CSQ_EX typedef NTSTATUS (NTAPI *PIO_CSQ_INSERT_IRP_EX) (struct _IO_CSQ *Csq, PIRP Irp, PVOID InsertContext); +#endif /* * CANCEL-SAFE QUEUE DDIs Modified: branches/header-work/include/ddk/ntddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntddk.h…
============================================================================== --- branches/header-work/include/ddk/ntddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/ntddk.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -2587,11 +2587,6 @@ MmMaximumRotateDirection } MM_ROTATE_DIRECTION, *PMM_ROTATE_DIRECTION; -#if (NTDDI_VERSION >= NTDDI_WIN2K) -typedef ULONG NODE_REQUIREMENT; -#define MM_ANY_NODE_OK 0x80000000 -#endif - /* Memory Manager Functions */ #if (NTDDI_VERSION >= NTDDI_WIN2K) Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -124,7 +124,6 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef struct _HAL_DISPATCH_TABLE *PHAL_DISPATCH_TABLE; typedef struct _HAL_PRIVATE_DISPATCH_TABLE *PHAL_PRIVATE_DISPATCH_TABLE; -typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT; typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT; typedef struct _EPROCESS *PEPROCESS; typedef struct _ETHREAD *PETHREAD; @@ -133,6 +132,14 @@ typedef struct _KPROCESS *PKPROCESS; typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD; typedef struct _CONTEXT *PCONTEXT; + +#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && ( defined(_NTDDK_) || defined(_NTDRIVER_) || defined(_NTOSP_)) +typedef struct _DMA_ADAPTER *PADAPTER_OBJECT; +#elif defined(_WDM_INCLUDED_) +typedef struct _DMA_ADAPTER *PADAPTER_OBJECT; +#else +typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT; +#endif /****************************************************************************** @@ -1508,12 +1515,17 @@ * Memory manager Types * ******************************************************************************/ -#define MM_DONT_ZERO_ALLOCATION 0x00000001 -#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002 -#define MM_ALLOCATE_FULLY_REQUIRED 0x00000004 -#define MM_ALLOCATE_NO_WAIT 0x00000008 -#define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010 -#define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020 +#if (NTDDI_VERSION >= NTDDI_WIN2K) +typedef ULONG NODE_REQUIREMENT; +#define MM_ANY_NODE_OK 0x80000000 +#endif + +#define MM_DONT_ZERO_ALLOCATION 0x00000001 +#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002 +#define MM_ALLOCATE_FULLY_REQUIRED 0x00000004 +#define MM_ALLOCATE_NO_WAIT 0x00000008 +#define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010 +#define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020 #define MDL_MAPPED_TO_SYSTEM_VA 0x0001 #define MDL_PAGES_LOCKED 0x0002 @@ -1722,10 +1734,11 @@ IN OUT PLOOKASIDE_LIST_EX Lookaside); typedef VOID -(NTAPI *PCALLBACK_FUNCTION)( - IN PVOID CallbackContext, - IN PVOID Argument1, - IN PVOID Argument2); +(NTAPI CALLBACK_FUNCTION)( + IN PVOID CallbackContext OPTIONAL, + IN PVOID Argument1 OPTIONAL, + IN PVOID Argument2 OPTIONAL); +typedef CALLBACK_FUNCTION *PCALLBACK_FUNCTION; #define GENERAL_LOOKASIDE_LAYOUT \ union { \ @@ -2115,6 +2128,11 @@ UNICODE_STRING ObjectName; UNICODE_STRING ObjectTypeName; } ACCESS_STATE, *PACCESS_STATE; + +typedef VOID +(NTAPI *PNTFS_DEREF_EXPORTED_SECURITY_DESCRIPTOR)( + IN PVOID Vcb, + IN PSECURITY_DESCRIPTOR SecurityDescriptor); #ifndef _NTLSA_IFS_ @@ -3291,10 +3309,11 @@ } REG_NOTIFY_CLASS, *PREG_NOTIFY_CLASS; typedef NTSTATUS -(NTAPI *PEX_CALLBACK_FUNCTION)( +(NTAPI EX_CALLBACK_FUNCTION)( IN PVOID CallbackContext, IN PVOID Argument1, IN PVOID Argument2); +typedef EX_CALLBACK_FUNCTION *PEX_CALLBACK_FUNCTION; typedef struct _REG_DELETE_KEY_INFORMATION { PVOID Object; @@ -3396,6 +3415,54 @@ PVOID Reserved; } REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION, *PREG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION; +typedef struct _REG_RENAME_KEY_INFORMATION { + PVOID Object; + PUNICODE_STRING NewName; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_RENAME_KEY_INFORMATION, *PREG_RENAME_KEY_INFORMATION; + +typedef struct _REG_CREATE_KEY_INFORMATION { + PUNICODE_STRING CompleteName; + PVOID RootObject; + PVOID ObjectType; + ULONG CreateOptions; + PUNICODE_STRING Class; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; + ACCESS_MASK DesiredAccess; + ACCESS_MASK GrantedAccess; + PULONG Disposition; + PVOID *ResultObject; + PVOID CallContext; + PVOID RootObjectContext; + PVOID Transaction; + PVOID Reserved; +} REG_CREATE_KEY_INFORMATION, REG_OPEN_KEY_INFORMATION,*PREG_CREATE_KEY_INFORMATION, *PREG_OPEN_KEY_INFORMATION; + +typedef struct _REG_CREATE_KEY_INFORMATION_V1 { + PUNICODE_STRING CompleteName; + PVOID RootObject; + PVOID ObjectType; + ULONG Options; + PUNICODE_STRING Class; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; + ACCESS_MASK DesiredAccess; + ACCESS_MASK GrantedAccess; + PULONG Disposition; + PVOID *ResultObject; + PVOID CallContext; + PVOID RootObjectContext; + PVOID Transaction; + ULONG_PTR Version; + PUNICODE_STRING RemainingName; + ULONG Wow64Flags; + ULONG Attributes; + KPROCESSOR_MODE CheckAccessMode; +} REG_CREATE_KEY_INFORMATION_V1, REG_OPEN_KEY_INFORMATION_V1,*PREG_CREATE_KEY_INFORMATION_V1, *PREG_OPEN_KEY_INFORMATION_V1; + typedef struct _REG_PRE_CREATE_KEY_INFORMATION { PUNICODE_STRING CompleteName; } REG_PRE_CREATE_KEY_INFORMATION, REG_PRE_OPEN_KEY_INFORMATION,*PREG_PRE_CREATE_KEY_INFORMATION, *PREG_PRE_OPEN_KEY_INFORMATION;; @@ -3423,6 +3490,84 @@ PVOID Reserved; } REG_KEY_HANDLE_CLOSE_INFORMATION, *PREG_KEY_HANDLE_CLOSE_INFORMATION; +#if (NTDDI_VERSION >= NTDDI_VISTA) + +typedef struct _REG_LOAD_KEY_INFORMATION { + PVOID Object; + PUNICODE_STRING KeyName; + PUNICODE_STRING SourceFile; + ULONG Flags; + PVOID TrustClassObject; + PVOID UserEvent; + ACCESS_MASK DesiredAccess; + PHANDLE RootHandle; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_LOAD_KEY_INFORMATION, *PREG_LOAD_KEY_INFORMATION; + +typedef struct _REG_UNLOAD_KEY_INFORMATION { + PVOID Object; + PVOID UserEvent; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_UNLOAD_KEY_INFORMATION, *PREG_UNLOAD_KEY_INFORMATION; + +typedef struct _REG_CALLBACK_CONTEXT_CLEANUP_INFORMATION { + PVOID Object; + PVOID ObjectContext; + PVOID Reserved; +} REG_CALLBACK_CONTEXT_CLEANUP_INFORMATION, *PREG_CALLBACK_CONTEXT_CLEANUP_INFORMATION; + +typedef struct _REG_QUERY_KEY_SECURITY_INFORMATION { + PVOID Object; + PSECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PULONG Length; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_QUERY_KEY_SECURITY_INFORMATION, *PREG_QUERY_KEY_SECURITY_INFORMATION; + +typedef struct _REG_SET_KEY_SECURITY_INFORMATION { + PVOID Object; + PSECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_SET_KEY_SECURITY_INFORMATION, *PREG_SET_KEY_SECURITY_INFORMATION; + +typedef struct _REG_RESTORE_KEY_INFORMATION { + PVOID Object; + HANDLE FileHandle; + ULONG Flags; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_RESTORE_KEY_INFORMATION, *PREG_RESTORE_KEY_INFORMATION; + +typedef struct _REG_SAVE_KEY_INFORMATION { + PVOID Object; + HANDLE FileHandle; + ULONG Format; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_SAVE_KEY_INFORMATION, *PREG_SAVE_KEY_INFORMATION; + +typedef struct _REG_REPLACE_KEY_INFORMATION { + PVOID Object; + PUNICODE_STRING OldFileName; + PUNICODE_STRING NewFileName; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_REPLACE_KEY_INFORMATION, *PREG_REPLACE_KEY_INFORMATION; + +#endif /* NTDDI_VERSION >= NTDDI_VISTA */ + #define SERVICE_KERNEL_DRIVER 0x00000001 #define SERVICE_FILE_SYSTEM_DRIVER 0x00000002 #define SERVICE_ADAPTER 0x00000004 @@ -3493,6 +3638,29 @@ /****************************************************************************** * I/O Manager Types * ******************************************************************************/ + +#define WDM_MAJORVERSION 0x06 +#define WDM_MINORVERSION 0x00 + +#if defined(_WIN64) + +#ifndef USE_DMA_MACROS +#define USE_DMA_MACROS +#endif + +#ifndef NO_LEGACY_DRIVERS +#define NO_LEGACY_DRIVERS +#endif + +#endif /* defined(_WIN64) */ + +#define STATUS_CONTINUE_COMPLETION STATUS_SUCCESS + +#define CONNECT_FULLY_SPECIFIED 0x1 +#define CONNECT_LINE_BASED 0x2 +#define CONNECT_MESSAGE_BASED 0x3 +#define CONNECT_FULLY_SPECIFIED_GROUP 0x4 +#define CONNECT_CURRENT_VERSION 0x4 /* PCI_COMMON_CONFIG.Command */ #define PCI_ENABLE_IO_SPACE 0x0001 @@ -3836,11 +4004,12 @@ } IO_ALLOCATION_ACTION, *PIO_ALLOCATION_ACTION; typedef IO_ALLOCATION_ACTION -(NTAPI *PDRIVER_CONTROL)( +(NTAPI DRIVER_CONTROL)( IN struct _DEVICE_OBJECT *DeviceObject, IN struct _IRP *Irp, IN PVOID MapRegisterBase, IN PVOID Context); +typedef DRIVER_CONTROL *PDRIVER_CONTROL; typedef struct _WAIT_CONTEXT_BLOCK { KDEVICE_QUEUE_ENTRY WaitQueueEntry; @@ -3883,6 +4052,153 @@ PVOID Reserved; } DEVICE_OBJECT, *PDEVICE_OBJECT; +typedef enum _IO_SESSION_STATE { + IoSessionStateCreated = 1, + IoSessionStateInitialized, + IoSessionStateConnected, + IoSessionStateDisconnected, + IoSessionStateDisconnectedLoggedOn, + IoSessionStateLoggedOn, + IoSessionStateLoggedOff, + IoSessionStateTerminated, + IoSessionStateMax +} IO_SESSION_STATE, *PIO_SESSION_STATE; + +typedef enum _IO_COMPLETION_ROUTINE_RESULT { + ContinueCompletion = STATUS_CONTINUE_COMPLETION, + StopCompletion = STATUS_MORE_PROCESSING_REQUIRED +} IO_COMPLETION_ROUTINE_RESULT, *PIO_COMPLETION_ROUTINE_RESULT; + +typedef struct _IO_INTERRUPT_MESSAGE_INFO_ENTRY { + PHYSICAL_ADDRESS MessageAddress; + KAFFINITY TargetProcessorSet; + PKINTERRUPT InterruptObject; + ULONG MessageData; + ULONG Vector; + KIRQL Irql; + KINTERRUPT_MODE Mode; + KINTERRUPT_POLARITY Polarity; +} IO_INTERRUPT_MESSAGE_INFO_ENTRY, *PIO_INTERRUPT_MESSAGE_INFO_ENTRY; + +typedef struct _IO_INTERRUPT_MESSAGE_INFO { + KIRQL UnifiedIrql; + ULONG MessageCount; + IO_INTERRUPT_MESSAGE_INFO_ENTRY MessageInfo[1]; +} IO_INTERRUPT_MESSAGE_INFO, *PIO_INTERRUPT_MESSAGE_INFO; + +typedef struct _IO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS { + IN PDEVICE_OBJECT PhysicalDeviceObject; + OUT PKINTERRUPT *InterruptObject; + IN PKSERVICE_ROUTINE ServiceRoutine; + IN PVOID ServiceContext; + IN PKSPIN_LOCK SpinLock OPTIONAL; + IN KIRQL SynchronizeIrql; + IN BOOLEAN FloatingSave; + IN BOOLEAN ShareVector; + IN ULONG Vector; + IN KIRQL Irql; + IN KINTERRUPT_MODE InterruptMode; + IN KAFFINITY ProcessorEnableMask; + IN USHORT Group; +} IO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS, *PIO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS; + +typedef struct _IO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS { + IN PDEVICE_OBJECT PhysicalDeviceObject; + OUT PKINTERRUPT *InterruptObject; + IN PKSERVICE_ROUTINE ServiceRoutine; + IN PVOID ServiceContext; + IN PKSPIN_LOCK SpinLock OPTIONAL; + IN KIRQL SynchronizeIrql OPTIONAL; + IN BOOLEAN FloatingSave; +} IO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS, *PIO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS; + +typedef struct _IO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS { + IN PDEVICE_OBJECT PhysicalDeviceObject; + union { + OUT PVOID *Generic; + OUT PIO_INTERRUPT_MESSAGE_INFO *InterruptMessageTable; + OUT PKINTERRUPT *InterruptObject; + } ConnectionContext; + IN PKMESSAGE_SERVICE_ROUTINE MessageServiceRoutine; + IN PVOID ServiceContext; + IN PKSPIN_LOCK SpinLock OPTIONAL; + IN KIRQL SynchronizeIrql OPTIONAL; + IN BOOLEAN FloatingSave; + IN PKSERVICE_ROUTINE FallBackServiceRoutine OPTIONAL; +} IO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS, *PIO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS; + +typedef struct _IO_CONNECT_INTERRUPT_PARAMETERS { + IN OUT ULONG Version; + union { + IO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS FullySpecified; + IO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS LineBased; + IO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS MessageBased; + }; +} IO_CONNECT_INTERRUPT_PARAMETERS, *PIO_CONNECT_INTERRUPT_PARAMETERS; + +typedef struct _IO_DISCONNECT_INTERRUPT_PARAMETERS { + IN ULONG Version; + union { + IN PVOID Generic; + IN PKINTERRUPT InterruptObject; + IN PIO_INTERRUPT_MESSAGE_INFO InterruptMessageTable; + } ConnectionContext; +} IO_DISCONNECT_INTERRUPT_PARAMETERS, *PIO_DISCONNECT_INTERRUPT_PARAMETERS; + +typedef enum _IO_ACCESS_TYPE { + ReadAccess, + WriteAccess, + ModifyAccess +} IO_ACCESS_TYPE; + +typedef enum _IO_ACCESS_MODE { + SequentialAccess, + RandomAccess +} IO_ACCESS_MODE; + +typedef enum _IO_CONTAINER_NOTIFICATION_CLASS { + IoSessionStateNotification, + IoMaxContainerNotificationClass +} IO_CONTAINER_NOTIFICATION_CLASS; + +typedef struct _IO_SESSION_STATE_NOTIFICATION { + ULONG Size; + ULONG Flags; + PVOID IoObject; + ULONG EventMask; + PVOID Context; +} IO_SESSION_STATE_NOTIFICATION, *PIO_SESSION_STATE_NOTIFICATION; + +typedef enum _IO_CONTAINER_INFORMATION_CLASS { + IoSessionStateInformation, + IoMaxContainerInformationClass +} IO_CONTAINER_INFORMATION_CLASS; + +typedef struct _IO_SESSION_STATE_INFORMATION { + ULONG SessionId; + IO_SESSION_STATE SessionState; + BOOLEAN LocalSession; +} IO_SESSION_STATE_INFORMATION, *PIO_SESSION_STATE_INFORMATION; + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +typedef NTSTATUS +(NTAPI *PIO_CONTAINER_NOTIFICATION_FUNCTION)( + VOID); + +typedef NTSTATUS +(NTAPI IO_SESSION_NOTIFICATION_FUNCTION)( + IN PVOID SessionObject, + IN PVOID IoObject, + IN ULONG Event, + IN PVOID Context, + IN PVOID NotificationPayload, + IN ULONG PayloadLength); + +typedef IO_SESSION_NOTIFICATION_FUNCTION *PIO_SESSION_NOTIFICATION_FUNCTION; + +#endif + typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK * PIO_REMOVE_LOCK_TRACKING_BLOCK; typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK { @@ -3919,6 +4235,13 @@ IN PDEVICE_OBJECT DeviceObject, IN PVOID Context); typedef IO_WORKITEM_ROUTINE *PIO_WORKITEM_ROUTINE; + +typedef VOID +(NTAPI IO_WORKITEM_ROUTINE_EX)( + IN PVOID IoObject, + IN PVOID Context OPTIONAL, + IN PIO_WORKITEM IoWorkItem); +typedef IO_WORKITEM_ROUTINE_EX *PIO_WORKITEM_ROUTINE_EX; typedef struct _SHARE_ACCESS { ULONG OpenCount; @@ -4082,18 +4405,6 @@ IoSessionEventMax } IO_SESSION_EVENT, *PIO_SESSION_EVENT; -typedef enum _IO_SESSION_STATE { - IoSessionStateCreated = 1, - IoSessionStateInitialized, - IoSessionStateConnected, - IoSessionStateDisconnected, - IoSessionStateDisconnectedLoggedOn, - IoSessionStateLoggedOn, - IoSessionStateLoggedOff, - IoSessionStateTerminated, - IoSessionStateMax -} IO_SESSION_STATE, *PIO_SESSION_STATE; - #define IO_SESSION_STATE_ALL_EVENTS 0xffffffff #define IO_SESSION_STATE_CREATION_EVENT 0x00000001 #define IO_SESSION_STATE_TERMINATION_EVENT 0x00000002 @@ -4110,11 +4421,6 @@ ULONG SessionId; BOOLEAN LocalSession; } IO_SESSION_CONNECT_INFO, *PIO_SESSION_CONNECT_INFO; - -typedef VOID -(NTAPI *WMI_NOTIFICATION_CALLBACK)( - PVOID Wnode, - PVOID Context); #define EVENT_INCREMENT 1 #define IO_NO_INCREMENT 0 @@ -4150,6 +4456,38 @@ BOOLEAN BootDeviceIsGpt; BOOLEAN SystemDeviceIsGpt; } BOOTDISK_INFORMATION_EX, *PBOOTDISK_INFORMATION_EX; + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +typedef struct _LOADER_PARTITION_INFORMATION_EX { + ULONG PartitionStyle; + ULONG PartitionNumber; + union { + ULONG Signature; + GUID DeviceId; + }; + ULONG Flags; +} LOADER_PARTITION_INFORMATION_EX, *PLOADER_PARTITION_INFORMATION_EX; + +typedef struct _BOOTDISK_INFORMATION_LITE { + ULONG NumberEntries; + LOADER_PARTITION_INFORMATION_EX Entries[1]; +} BOOTDISK_INFORMATION_LITE, *PBOOTDISK_INFORMATION_LITE; + +#else + +#if (NTDDI_VERSION >= NTDDI_VISTA) +typedef struct _BOOTDISK_INFORMATION_LITE { + ULONG BootDeviceSignature; + ULONG SystemDeviceSignature; + GUID BootDeviceGuid; + GUID SystemDeviceGuid; + BOOLEAN BootDeviceIsGpt; + BOOLEAN SystemDeviceIsGpt; +} BOOTDISK_INFORMATION_LITE, *PBOOTDISK_INFORMATION_LITE; +#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ + +#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ #include <pshpack1.h> @@ -4684,7 +5022,7 @@ #define FM_LOCK_WAITER_INC (0x4) typedef BOOLEAN -(NTAPI *PFAST_IO_CHECK_IF_POSSIBLE)( +(NTAPI FAST_IO_CHECK_IF_POSSIBLE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -4693,9 +5031,10 @@ IN BOOLEAN CheckForReadOperation, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_CHECK_IF_POSSIBLE *PFAST_IO_CHECK_IF_POSSIBLE; typedef BOOLEAN -(NTAPI *PFAST_IO_READ)( +(NTAPI FAST_IO_READ)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -4704,9 +5043,10 @@ OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_READ *PFAST_IO_READ; typedef BOOLEAN -(NTAPI *PFAST_IO_WRITE)( +(NTAPI FAST_IO_WRITE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -4715,25 +5055,28 @@ IN PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_WRITE *PFAST_IO_WRITE; typedef BOOLEAN -(NTAPI *PFAST_IO_QUERY_BASIC_INFO)( +(NTAPI FAST_IO_QUERY_BASIC_INFO)( IN struct _FILE_OBJECT *FileObject, IN BOOLEAN Wait, OUT PFILE_BASIC_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_QUERY_BASIC_INFO *PFAST_IO_QUERY_BASIC_INFO; typedef BOOLEAN -(NTAPI *PFAST_IO_QUERY_STANDARD_INFO)( +(NTAPI FAST_IO_QUERY_STANDARD_INFO)( IN struct _FILE_OBJECT *FileObject, IN BOOLEAN Wait, OUT PFILE_STANDARD_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_QUERY_STANDARD_INFO *PFAST_IO_QUERY_STANDARD_INFO; typedef BOOLEAN -(NTAPI *PFAST_IO_LOCK)( +(NTAPI FAST_IO_LOCK)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, @@ -4743,9 +5086,10 @@ BOOLEAN ExclusiveLock, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_LOCK *PFAST_IO_LOCK; typedef BOOLEAN -(NTAPI *PFAST_IO_UNLOCK_SINGLE)( +(NTAPI FAST_IO_UNLOCK_SINGLE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, @@ -4753,24 +5097,27 @@ ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_UNLOCK_SINGLE *PFAST_IO_UNLOCK_SINGLE; typedef BOOLEAN -(NTAPI *PFAST_IO_UNLOCK_ALL)( +(NTAPI FAST_IO_UNLOCK_ALL)( IN struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_UNLOCK_ALL *PFAST_IO_UNLOCK_ALL; typedef BOOLEAN -(NTAPI *PFAST_IO_UNLOCK_ALL_BY_KEY)( +(NTAPI FAST_IO_UNLOCK_ALL_BY_KEY)( IN struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_UNLOCK_ALL_BY_KEY *PFAST_IO_UNLOCK_ALL_BY_KEY; typedef BOOLEAN -(NTAPI *PFAST_IO_DEVICE_CONTROL)( +(NTAPI FAST_IO_DEVICE_CONTROL)( IN struct _FILE_OBJECT *FileObject, IN BOOLEAN Wait, IN PVOID InputBuffer OPTIONAL, @@ -4780,37 +5127,43 @@ IN ULONG IoControlCode, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_DEVICE_CONTROL *PFAST_IO_DEVICE_CONTROL; typedef VOID -(NTAPI *PFAST_IO_ACQUIRE_FILE)( +(NTAPI FAST_IO_ACQUIRE_FILE)( IN struct _FILE_OBJECT *FileObject); +typedef FAST_IO_ACQUIRE_FILE *PFAST_IO_ACQUIRE_FILE; typedef VOID -(NTAPI *PFAST_IO_RELEASE_FILE)( +(NTAPI FAST_IO_RELEASE_FILE)( IN struct _FILE_OBJECT *FileObject); +typedef FAST_IO_RELEASE_FILE *PFAST_IO_RELEASE_FILE; typedef VOID -(NTAPI *PFAST_IO_DETACH_DEVICE)( +(NTAPI FAST_IO_DETACH_DEVICE)( IN struct _DEVICE_OBJECT *SourceDevice, IN struct _DEVICE_OBJECT *TargetDevice); +typedef FAST_IO_DETACH_DEVICE *PFAST_IO_DETACH_DEVICE; typedef BOOLEAN -(NTAPI *PFAST_IO_QUERY_NETWORK_OPEN_INFO)( +(NTAPI FAST_IO_QUERY_NETWORK_OPEN_INFO)( IN struct _FILE_OBJECT *FileObject, IN BOOLEAN Wait, OUT struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, OUT struct _IO_STATUS_BLOCK *IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_QUERY_NETWORK_OPEN_INFO *PFAST_IO_QUERY_NETWORK_OPEN_INFO; typedef NTSTATUS -(NTAPI *PFAST_IO_ACQUIRE_FOR_MOD_WRITE)( +(NTAPI FAST_IO_ACQUIRE_FOR_MOD_WRITE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER EndingOffset, OUT struct _ERESOURCE **ResourceToRelease, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_ACQUIRE_FOR_MOD_WRITE *PFAST_IO_ACQUIRE_FOR_MOD_WRITE; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_READ)( +(NTAPI FAST_IO_MDL_READ)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -4818,15 +5171,17 @@ OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_READ *PFAST_IO_MDL_READ; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_READ_COMPLETE)( +(NTAPI FAST_IO_MDL_READ_COMPLETE)( IN struct _FILE_OBJECT *FileObject, IN PMDL MdlChain, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_READ_COMPLETE *PFAST_IO_MDL_READ_COMPLETE; typedef BOOLEAN -(NTAPI *PFAST_IO_PREPARE_MDL_WRITE)( +(NTAPI FAST_IO_PREPARE_MDL_WRITE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -4834,16 +5189,18 @@ OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_PREPARE_MDL_WRITE *PFAST_IO_PREPARE_MDL_WRITE; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_WRITE_COMPLETE)( +(NTAPI FAST_IO_MDL_WRITE_COMPLETE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_WRITE_COMPLETE *PFAST_IO_MDL_WRITE_COMPLETE; typedef BOOLEAN -(NTAPI *PFAST_IO_READ_COMPRESSED)( +(NTAPI FAST_IO_READ_COMPRESSED)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -4854,9 +5211,10 @@ OUT struct _COMPRESSED_DATA_INFO *CompressedDataInfo, IN ULONG CompressedDataInfoLength, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_READ_COMPRESSED *PFAST_IO_READ_COMPRESSED; typedef BOOLEAN -(NTAPI *PFAST_IO_WRITE_COMPRESSED)( +(NTAPI FAST_IO_WRITE_COMPRESSED)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -4867,41 +5225,48 @@ IN struct _COMPRESSED_DATA_INFO *CompressedDataInfo, IN ULONG CompressedDataInfoLength, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_WRITE_COMPRESSED *PFAST_IO_WRITE_COMPRESSED; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_READ_COMPLETE_COMPRESSED)( +(NTAPI FAST_IO_MDL_READ_COMPLETE_COMPRESSED)( IN struct _FILE_OBJECT *FileObject, IN PMDL MdlChain, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_READ_COMPLETE_COMPRESSED *PFAST_IO_MDL_READ_COMPLETE_COMPRESSED; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED)( +(NTAPI FAST_IO_MDL_WRITE_COMPLETE_COMPRESSED)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_WRITE_COMPLETE_COMPRESSED *PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED; typedef BOOLEAN -(NTAPI *PFAST_IO_QUERY_OPEN)( +(NTAPI FAST_IO_QUERY_OPEN)( IN struct _IRP *Irp, OUT PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_QUERY_OPEN *PFAST_IO_QUERY_OPEN; typedef NTSTATUS -(NTAPI *PFAST_IO_RELEASE_FOR_MOD_WRITE)( +(NTAPI FAST_IO_RELEASE_FOR_MOD_WRITE)( IN struct _FILE_OBJECT *FileObject, IN struct _ERESOURCE *ResourceToRelease, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_RELEASE_FOR_MOD_WRITE *PFAST_IO_RELEASE_FOR_MOD_WRITE; typedef NTSTATUS -(NTAPI *PFAST_IO_ACQUIRE_FOR_CCFLUSH)( +(NTAPI FAST_IO_ACQUIRE_FOR_CCFLUSH)( IN struct _FILE_OBJECT *FileObject, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_ACQUIRE_FOR_CCFLUSH *PFAST_IO_ACQUIRE_FOR_CCFLUSH; typedef NTSTATUS -(NTAPI *PFAST_IO_RELEASE_FOR_CCFLUSH) ( +(NTAPI FAST_IO_RELEASE_FOR_CCFLUSH)( IN struct _FILE_OBJECT *FileObject, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_RELEASE_FOR_CCFLUSH *PFAST_IO_RELEASE_FOR_CCFLUSH; typedef struct _FAST_IO_DISPATCH { ULONG SizeOfFastIoDispatch; @@ -4975,6 +5340,7 @@ #define FO_SKIP_COMPLETION_PORT 0x02000000 #define FO_SKIP_SET_EVENT 0x04000000 #define FO_SKIP_SET_FAST_IO 0x08000000 +#define FO_FLAGS_VALID_ONLY_DURING_CREATE FO_DISALLOW_EXCLUSIVE /* VPB.Flags */ #define VPB_MOUNTED 0x0001 @@ -4989,12 +5355,18 @@ #define SL_FORCE_ACCESS_CHECK 0x01 #define SL_OPEN_PAGING_FILE 0x02 #define SL_OPEN_TARGET_DIRECTORY 0x04 +#define SL_STOP_ON_SYMLINK 0x08 #define SL_CASE_SENSITIVE 0x80 #define SL_KEY_SPECIFIED 0x01 #define SL_OVERRIDE_VERIFY_VOLUME 0x02 #define SL_WRITE_THROUGH 0x04 #define SL_FT_SEQUENTIAL_WRITE 0x08 +#define SL_FORCE_DIRECT_WRITE 0x10 +#define SL_REALTIME_STREAM 0x20 + +#define SL_READ_ACCESS_GRANTED 0x01 +#define SL_WRITE_ACCESS_GRANTED 0x04 #define SL_FAIL_IMMEDIATELY 0x01 #define SL_EXCLUSIVE_LOCK 0x02 @@ -5099,6 +5471,9 @@ #define IRP_MN_QUERY_BUS_INFORMATION 0x15 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16 #define IRP_MN_SURPRISE_REMOVAL 0x17 +#if (NTDDI_VERSION >= NTDDI_WIN7) +#define IRP_MN_DEVICE_ENUMERATED 0x19 +#endif #define IRP_MN_WAIT_WAKE 0x00 #define IRP_MN_POWER_SEQUENCE 0x01 @@ -5635,11 +6010,12 @@ typedef IO_COMPLETION_ROUTINE *PIO_COMPLETION_ROUTINE; typedef VOID -(NTAPI *PIO_DPC_ROUTINE)( +(NTAPI IO_DPC_ROUTINE)( IN struct _KDPC *Dpc, IN struct _DEVICE_OBJECT *DeviceObject, IN struct _IRP *Irp, IN PVOID Context); +typedef IO_DPC_ROUTINE *PIO_DPC_ROUTINE; typedef NTSTATUS (NTAPI *PMM_DLL_INITIALIZE)( @@ -5650,9 +6026,10 @@ VOID); typedef VOID -(NTAPI *PIO_TIMER_ROUTINE)( +(NTAPI IO_TIMER_ROUTINE)( IN struct _DEVICE_OBJECT *DeviceObject, IN PVOID Context); +typedef IO_TIMER_ROUTINE *PIO_TIMER_ROUTINE; typedef struct _IO_SECURITY_CONTEXT { PSECURITY_QUALITY_OF_SERVICE SecurityQos; @@ -5673,6 +6050,13 @@ (NTAPI *PIO_CSQ_INSERT_IRP)( IN struct _IO_CSQ *Csq, IN PIRP Irp); + +typedef NTSTATUS +(NTAPI IO_CSQ_INSERT_IRP_EX)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp, + IN PVOID InsertContext); +typedef IO_CSQ_INSERT_IRP_EX *PIO_CSQ_INSERT_IRP_EX; typedef VOID (NTAPI *PIO_CSQ_REMOVE_IRP)( @@ -6121,6 +6505,21 @@ /* end winnt.h */ +#define WMIREG_ACTION_REGISTER 1 +#define WMIREG_ACTION_DEREGISTER 2 +#define WMIREG_ACTION_REREGISTER 3 +#define WMIREG_ACTION_UPDATE_GUIDS 4 +#define WMIREG_ACTION_BLOCK_IRPS 5 + +#define WMIREGISTER 0 +#define WMIUPDATE 1 + +typedef VOID +(NTAPI FWMI_NOTIFICATION_CALLBACK)( + PVOID Wnode, + PVOID Context); +typedef FWMI_NOTIFICATION_CALLBACK *WMI_NOTIFICATION_CALLBACK; + /****************************************************************************** * Object Manager Types * ******************************************************************************/ @@ -9039,6 +9438,9 @@ ((ULONG) ((((ULONG_PTR) (_Va) & (PAGE_SIZE - 1)) \ + (_Size) + (PAGE_SIZE - 1)) >> PAGE_SHIFT)) +#define COMPUTE_PAGES_SPANNED(Va, Size) \ + ADDRESS_AND_SIZE_TO_SPAN_PAGES(Va,Size) + /* * ULONG * MmGetMdlByteCount( @@ -9054,6 +9456,8 @@ */ #define MmGetMdlByteOffset(_Mdl) \ ((_Mdl)->ByteOffset) + +#define MmGetMdlBaseVa(Mdl) ((Mdl)->StartVa) /* * PPFN_NUMBER @@ -9303,6 +9707,17 @@ IN PVOID BaseAddress, IN PMDL MemoryDescriptorList); +NTKERNELAPI +PVOID +NTAPI +MmAllocateContiguousMemorySpecifyCacheNode( + IN SIZE_T NumberOfBytes, + IN PHYSICAL_ADDRESS LowestAcceptableAddress, + IN PHYSICAL_ADDRESS HighestAcceptableAddress, + IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL, + IN MEMORY_CACHING_TYPE CacheType, + IN NODE_REQUIREMENT PreferredNode); + #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ #if (NTDDI_VERSION >= NTDDI_WINXP) @@ -9358,7 +9773,23 @@ IN ULONG PoolTag, IN PMDL MemoryDescriptorList); +NTKERNELAPI +NTSTATUS +NTAPI +MmAddVerifierThunks( + IN PVOID ThunkBuffer, + IN ULONG ThunkBufferSize); + #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + +#if (NTDDI_VERSION >= NTDDI_WS03) +NTKERNELAPI +LOGICAL +NTAPI +MmIsIoSpaceActive( + IN PHYSICAL_ADDRESS StartAddress, + IN SIZE_T NumberOfBytes); +#endif #if (NTDDI_VERSION >= NTDDI_WS03SP1) NTKERNELAPI @@ -9371,6 +9802,14 @@ IN SIZE_T TotalBytes, IN MEMORY_CACHING_TYPE CacheType, IN ULONG Flags); +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) +NTKERNELAPI +LOGICAL +NTAPI +MmIsDriverVerifyingByAddress( + IN PVOID AddressWithinSection); #endif /****************************************************************************** @@ -9525,6 +9964,53 @@ CmUnRegisterCallback( IN LARGE_INTEGER Cookie); #endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +NTKERNELAPI +NTSTATUS +NTAPI +CmRegisterCallbackEx( + PEX_CALLBACK_FUNCTION Function, + PCUNICODE_STRING Altitude, + PVOID Driver, + PVOID Context, + PLARGE_INTEGER Cookie, + PVOID Reserved); + +NTKERNELAPI +VOID +NTAPI +CmGetCallbackVersion( + OUT PULONG Major OPTIONAL, + OUT PULONG Minor OPTIONAL); + +NTKERNELAPI +NTSTATUS +NTAPI +CmSetCallbackObjectContext( + IN OUT PVOID Object, + IN PLARGE_INTEGER Cookie, + IN PVOID NewContext, + OUT PVOID *OldContext OPTIONAL); + +NTKERNELAPI +NTSTATUS +NTAPI +CmCallbackGetKeyObjectID( + IN PLARGE_INTEGER Cookie, + IN PVOID Object, + OUT PULONG_PTR ObjectID OPTIONAL, + OUT PCUNICODE_STRING *ObjectName OPTIONAL); + +NTKERNELAPI +PVOID +NTAPI +CmGetBoundTransaction( + IN PLARGE_INTEGER Cookie, + IN PVOID Object); + +#endif // NTDDI_VERSION >= NTDDI_VISTA /****************************************************************************** @@ -10703,13 +11189,30 @@ NTSTATUS NTAPI IoWMIWriteEvent( - IN PVOID WnodeEventItem); + IN OUT PVOID WnodeEventItem); NTKERNELAPI VOID NTAPI IoWriteErrorLogEntry( IN PVOID ElEntry); + +NTKERNELAPI +PIRP +NTAPI +IoGetTopLevelIrp(VOID); + +NTKERNELAPI +NTSTATUS +NTAPI +IoRegisterLastChanceShutdownNotification( + IN PDEVICE_OBJECT DeviceObject); + +NTKERNELAPI +VOID +NTAPI +IoSetTopLevelIrp( + IN PIRP Irp OPTIONAL); #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ @@ -10747,7 +11250,7 @@ NTAPI IoCsqRemoveNextIrp( IN PIO_CSQ Csq, - IN PVOID PeekContext); + IN PVOID PeekContext OPTIONAL); NTKERNELAPI BOOLEAN @@ -10874,6 +11377,178 @@ IN PVOID ValueBuffer); #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + +#if (NTDDI_VERSION >= NTDDI_WINXPSP1) +NTKERNELAPI +NTSTATUS +NTAPI +IoValidateDeviceIoControlAccess( + IN PIRP Irp, + IN ULONG RequiredAccess); +#endif + +#if (NTDDI_VERSION >= NTDDI_WS03) + +NTKERNELAPI +NTSTATUS +NTAPI +IoCsqInitializeEx( + IN PIO_CSQ Csq, + IN PIO_CSQ_INSERT_IRP_EX CsqInsertIrp, + IN PIO_CSQ_REMOVE_IRP CsqRemoveIrp, + IN PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, + IN PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, + IN PIO_CSQ_RELEASE_LOCK CsqReleaseLock, + IN PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); + +NTKERNELAPI +NTSTATUS +NTAPI +IoCsqInsertIrpEx( + IN PIO_CSQ Csq, + IN PIRP Irp, + IN PIO_CSQ_IRP_CONTEXT Context OPTIONAL, + IN PVOID InsertContext OPTIONAL); + +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +NTKERNELAPI +NTSTATUS +NTAPI +IoGetBootDiskInformationLite( + OUT PBOOTDISK_INFORMATION_LITE *BootDiskInformation); + +NTKERNELAPI +NTSTATUS +NTAPI +IoCheckShareAccessEx( + IN ACCESS_MASK DesiredAccess, + IN ULONG DesiredShareAccess, + IN OUT PFILE_OBJECT FileObject, + IN OUT PSHARE_ACCESS ShareAccess, + IN BOOLEAN Update, + IN PBOOLEAN WritePermission); + +NTKERNELAPI +NTSTATUS +NTAPI +IoConnectInterruptEx( + IN OUT PIO_CONNECT_INTERRUPT_PARAMETERS Parameters); + +NTKERNELAPI +VOID +NTAPI +IoDisconnectInterruptEx( + IN PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters); + +LOGICAL +NTAPI +IoWithinStackLimits( + IN ULONG_PTR RegionStart, + IN SIZE_T RegionSize); + +NTKERNELAPI +VOID +NTAPI +IoSetShareAccessEx( + IN ACCESS_MASK DesiredAccess, + IN ULONG DesiredShareAccess, + IN OUT PFILE_OBJECT FileObject, + OUT PSHARE_ACCESS ShareAccess, + IN PBOOLEAN WritePermission); + +ULONG +NTAPI +IoSizeofWorkItem(VOID); + +VOID +NTAPI +IoInitializeWorkItem( + IN PVOID IoObject, + IN PIO_WORKITEM IoWorkItem); + +VOID +NTAPI +IoUninitializeWorkItem( + IN PIO_WORKITEM IoWorkItem); + +VOID +NTAPI +IoQueueWorkItemEx( + IN PIO_WORKITEM IoWorkItem, + IN PIO_WORKITEM_ROUTINE_EX WorkerRoutine, + IN WORK_QUEUE_TYPE QueueType, + IN PVOID Context OPTIONAL); + +IO_PRIORITY_HINT +NTAPI +IoGetIoPriorityHint( + IN PIRP Irp); + +NTSTATUS +NTAPI +IoSetIoPriorityHint( + IN PIRP Irp, + IN IO_PRIORITY_HINT PriorityHint); + +NTSTATUS +NTAPI +IoAllocateSfioStreamIdentifier( + IN PFILE_OBJECT FileObject, + IN ULONG Length, + IN PVOID Signature, + OUT PVOID *StreamIdentifier); + +PVOID +NTAPI +IoGetSfioStreamIdentifier( + IN PFILE_OBJECT FileObject, + IN PVOID Signature); + +NTSTATUS +NTAPI +IoFreeSfioStreamIdentifier( + IN PFILE_OBJECT FileObject, + IN PVOID Signature); + +#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ + +#define IoCallDriverStackSafeDefault(a, b) IoCallDriver(a, b) + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +NTKERNELAPI +NTSTATUS +NTAPI +IoGetAffinityInterrupt( + IN PKINTERRUPT InterruptObject, + OUT PGROUP_AFFINITY GroupAffinity); + +NTSTATUS +NTAPI +IoGetContainerInformation( + IN IO_CONTAINER_INFORMATION_CLASS InformationClass, + IN PVOID ContainerObject OPTIONAL, + IN OUT PVOID Buffer OPTIONAL, + IN ULONG BufferLength); + +NTSTATUS +NTAPI +IoRegisterContainerNotification( + IN IO_CONTAINER_NOTIFICATION_CLASS NotificationClass, + IN PIO_CONTAINER_NOTIFICATION_FUNCTION CallbackFunction, + IN PVOID NotificationInformation OPTIONAL, + IN ULONG NotificationInformationLength, + OUT PVOID CallbackRegistration); + +VOID +NTAPI +IoUnregisterContainerNotification( + IN PVOID CallbackRegistration); + +#endif #if defined(_WIN64) NTKERNELAPI @@ -11071,7 +11746,7 @@ FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext( - IN PIRP Irp) + IN OUT PIRP Irp) { PIO_STACK_LOCATION irpSp; PIO_STACK_LOCATION nextIrpSp; @@ -11099,6 +11774,19 @@ Result = (ULONG_PTR)(&End) - Begin; return Result; } + +#if (NTDDI_VERSION >= NTDDI_WS03) +VOID +FORCEINLINE +IoInitializeThreadedDpcRequest( + IN PDEVICE_OBJECT DeviceObject, + IN PIO_DPC_ROUTINE DpcRoutine) +{ + KeInitializeThreadedDpc(&DeviceObject->Dpc, + (PKDEFERRED_ROUTINE) DpcRoutine, + DeviceObject ); +} +#endif /****************************************************************************** * Power Management Support Functions * @@ -11468,7 +12156,7 @@ * ExGetCurrentResourceThread( * VOID); */ -#define ExGetCurrentResourceThread() ((ERESOURCE_THREAD)PsGetCurrentThread()) +#define ExGetCurrentResourceThread() ((ULONG_PTR)PsGetCurrentThread()) #define ExReleaseResource(R) (ExReleaseResourceLite(R)) @@ -11515,7 +12203,7 @@ BOOLEAN NTAPI ExAcquireResourceExclusiveLite( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN BOOLEAN Wait); NTKERNELAPI @@ -11529,14 +12217,14 @@ BOOLEAN NTAPI ExAcquireSharedStarveExclusive( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN BOOLEAN Wait); NTKERNELAPI BOOLEAN NTAPI ExAcquireSharedWaitForExclusive( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN BOOLEAN Wait); NTKERNELAPI @@ -11590,7 +12278,7 @@ VOID NTAPI ExConvertExclusiveToSharedLite( - IN PERESOURCE Resource); + IN OUT PERESOURCE Resource); NTKERNELAPI NTSTATUS @@ -11617,7 +12305,7 @@ NTSTATUS NTAPI ExDeleteResourceLite( - IN PERESOURCE Resource); + IN OUT PERESOURCE Resource); NTKERNELAPI VOID @@ -11804,8 +12492,8 @@ NTAPI ExNotifyCallback( IN PCALLBACK_OBJECT CallbackObject, - IN PVOID Argument1, - IN PVOID Argument2); + IN PVOID Argument1 OPTIONAL, + IN PVOID Argument2 OPTIONAL); NTKERNELAPI VOID @@ -11827,7 +12515,7 @@ ExRegisterCallback( IN PCALLBACK_OBJECT CallbackObject, IN PCALLBACK_FUNCTION CallbackFunction, - IN PVOID CallbackContext); + IN PVOID CallbackContext OPTIONAL); NTKERNELAPI NTSTATUS @@ -11839,20 +12527,20 @@ VOID NTAPI ExReleaseResourceForThreadLite( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN ERESOURCE_THREAD ResourceThreadId); NTKERNELAPI VOID FASTCALL ExReleaseResourceLite( - IN PERESOURCE Resource); + IN OUT PERESOURCE Resource); NTKERNELAPI VOID NTAPI ExSetResourceOwnerPointer( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN PVOID OwnerPointer); NTKERNELAPI @@ -11873,7 +12561,7 @@ VOID NTAPI ExUnregisterCallback( - IN PVOID CbRegistration); + IN OUT PVOID CbRegistration); #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ @@ -11895,7 +12583,7 @@ VOID FASTCALL ExReInitializeRundownProtection( - OUT PEX_RUNDOWN_REF RunRef); + IN OUT PEX_RUNDOWN_REF RunRef); NTKERNELAPI VOID @@ -11954,6 +12642,87 @@ SIZE_T NTAPI ExSizeOfRundownProtectionCacheAware(VOID); + +NTKERNELAPI +PVOID +NTAPI +ExEnterCriticalRegionAndAcquireResourceShared( + IN OUT PERESOURCE Resource); + +NTKERNELAPI +PVOID +NTAPI +ExEnterCriticalRegionAndAcquireResourceExclusive( + IN OUT PERESOURCE Resource); + +NTKERNELAPI +PVOID +NTAPI +ExEnterCriticalRegionAndAcquireSharedWaitForExclusive( + IN OUT PERESOURCE Resource); + +NTKERNELAPI +VOID +FASTCALL +ExReleaseResourceAndLeaveCriticalRegion( + IN OUT PERESOURCE Resource); + +NTKERNELAPI +VOID +NTAPI +ExInitializeRundownProtectionCacheAware( + OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, + IN SIZE_T RunRefSize); + +NTKERNELAPI +VOID +NTAPI +ExFreeCacheAwareRundownProtection( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); + +NTKERNELAPI +BOOLEAN +FASTCALL +ExAcquireRundownProtectionCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); + +NTKERNELAPI +VOID +FASTCALL +ExReleaseRundownProtectionCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); + +NTKERNELAPI +BOOLEAN +FASTCALL +ExAcquireRundownProtectionCacheAwareEx( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, + IN ULONG Count); + +NTKERNELAPI +VOID +FASTCALL +ExReleaseRundownProtectionCacheAwareEx( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRef, + IN ULONG Count); + +NTKERNELAPI +VOID +FASTCALL +ExWaitForRundownProtectionReleaseCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRef); + +NTKERNELAPI +VOID +FASTCALL +ExReInitializeRundownProtectionCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); + +NTKERNELAPI +VOID +FASTCALL +ExRundownCompletedCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); #endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */ @@ -12020,6 +12789,20 @@ } #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +NTKERNELAPI +VOID +NTAPI +ExSetResourceOwnerPointerEx( + IN OUT PERESOURCE Resource, + IN PVOID OwnerPointer, + IN ULONG Flags); + +#define FLAG_OWNER_POINTER_IS_THREAD 0x1 + +#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ static __inline PVOID ExAllocateFromNPagedLookasideList( @@ -12168,6 +12951,13 @@ #endif +NTKERNELAPI +NTSTATUS +NTAPI +PsWrapApcWow64Thread( + IN OUT PVOID *ApcContext, + IN OUT PVOID *ApcRoutine); + /****************************************************************************** * WMI Library Support Functions * ******************************************************************************/ @@ -13859,6 +14649,9 @@ typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE; #endif +extern PBOOLEAN Mm64BitPhysicalAddress; + +extern PVOID MmBadPointer; #ifdef __cplusplus Modified: branches/header-work/include/xdk/cmfuncs.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/cmfuncs…
============================================================================== --- branches/header-work/include/xdk/cmfuncs.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/cmfuncs.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -19,5 +19,52 @@ IN LARGE_INTEGER Cookie); #endif +#if (NTDDI_VERSION >= NTDDI_VISTA) + +NTKERNELAPI +NTSTATUS +NTAPI +CmRegisterCallbackEx( + PEX_CALLBACK_FUNCTION Function, + PCUNICODE_STRING Altitude, + PVOID Driver, + PVOID Context, + PLARGE_INTEGER Cookie, + PVOID Reserved); + +NTKERNELAPI +VOID +NTAPI +CmGetCallbackVersion( + OUT PULONG Major OPTIONAL, + OUT PULONG Minor OPTIONAL); + +NTKERNELAPI +NTSTATUS +NTAPI +CmSetCallbackObjectContext( + IN OUT PVOID Object, + IN PLARGE_INTEGER Cookie, + IN PVOID NewContext, + OUT PVOID *OldContext OPTIONAL); + +NTKERNELAPI +NTSTATUS +NTAPI +CmCallbackGetKeyObjectID( + IN PLARGE_INTEGER Cookie, + IN PVOID Object, + OUT PULONG_PTR ObjectID OPTIONAL, + OUT PCUNICODE_STRING *ObjectName OPTIONAL); + +NTKERNELAPI +PVOID +NTAPI +CmGetBoundTransaction( + IN PLARGE_INTEGER Cookie, + IN PVOID Object); + +#endif // NTDDI_VERSION >= NTDDI_VISTA + $endif Modified: branches/header-work/include/xdk/cmtypes.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/cmtypes…
============================================================================== --- branches/header-work/include/xdk/cmtypes.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/cmtypes.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -681,10 +681,11 @@ } REG_NOTIFY_CLASS, *PREG_NOTIFY_CLASS; typedef NTSTATUS -(NTAPI *PEX_CALLBACK_FUNCTION)( +(NTAPI EX_CALLBACK_FUNCTION)( IN PVOID CallbackContext, IN PVOID Argument1, IN PVOID Argument2); +typedef EX_CALLBACK_FUNCTION *PEX_CALLBACK_FUNCTION; typedef struct _REG_DELETE_KEY_INFORMATION { PVOID Object; @@ -786,6 +787,54 @@ PVOID Reserved; } REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION, *PREG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION; +typedef struct _REG_RENAME_KEY_INFORMATION { + PVOID Object; + PUNICODE_STRING NewName; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_RENAME_KEY_INFORMATION, *PREG_RENAME_KEY_INFORMATION; + +typedef struct _REG_CREATE_KEY_INFORMATION { + PUNICODE_STRING CompleteName; + PVOID RootObject; + PVOID ObjectType; + ULONG CreateOptions; + PUNICODE_STRING Class; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; + ACCESS_MASK DesiredAccess; + ACCESS_MASK GrantedAccess; + PULONG Disposition; + PVOID *ResultObject; + PVOID CallContext; + PVOID RootObjectContext; + PVOID Transaction; + PVOID Reserved; +} REG_CREATE_KEY_INFORMATION, REG_OPEN_KEY_INFORMATION,*PREG_CREATE_KEY_INFORMATION, *PREG_OPEN_KEY_INFORMATION; + +typedef struct _REG_CREATE_KEY_INFORMATION_V1 { + PUNICODE_STRING CompleteName; + PVOID RootObject; + PVOID ObjectType; + ULONG Options; + PUNICODE_STRING Class; + PVOID SecurityDescriptor; + PVOID SecurityQualityOfService; + ACCESS_MASK DesiredAccess; + ACCESS_MASK GrantedAccess; + PULONG Disposition; + PVOID *ResultObject; + PVOID CallContext; + PVOID RootObjectContext; + PVOID Transaction; + ULONG_PTR Version; + PUNICODE_STRING RemainingName; + ULONG Wow64Flags; + ULONG Attributes; + KPROCESSOR_MODE CheckAccessMode; +} REG_CREATE_KEY_INFORMATION_V1, REG_OPEN_KEY_INFORMATION_V1,*PREG_CREATE_KEY_INFORMATION_V1, *PREG_OPEN_KEY_INFORMATION_V1; + typedef struct _REG_PRE_CREATE_KEY_INFORMATION { PUNICODE_STRING CompleteName; } REG_PRE_CREATE_KEY_INFORMATION, REG_PRE_OPEN_KEY_INFORMATION,*PREG_PRE_CREATE_KEY_INFORMATION, *PREG_PRE_OPEN_KEY_INFORMATION;; @@ -812,6 +861,84 @@ PVOID ObjectContext; PVOID Reserved; } REG_KEY_HANDLE_CLOSE_INFORMATION, *PREG_KEY_HANDLE_CLOSE_INFORMATION; + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +typedef struct _REG_LOAD_KEY_INFORMATION { + PVOID Object; + PUNICODE_STRING KeyName; + PUNICODE_STRING SourceFile; + ULONG Flags; + PVOID TrustClassObject; + PVOID UserEvent; + ACCESS_MASK DesiredAccess; + PHANDLE RootHandle; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_LOAD_KEY_INFORMATION, *PREG_LOAD_KEY_INFORMATION; + +typedef struct _REG_UNLOAD_KEY_INFORMATION { + PVOID Object; + PVOID UserEvent; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_UNLOAD_KEY_INFORMATION, *PREG_UNLOAD_KEY_INFORMATION; + +typedef struct _REG_CALLBACK_CONTEXT_CLEANUP_INFORMATION { + PVOID Object; + PVOID ObjectContext; + PVOID Reserved; +} REG_CALLBACK_CONTEXT_CLEANUP_INFORMATION, *PREG_CALLBACK_CONTEXT_CLEANUP_INFORMATION; + +typedef struct _REG_QUERY_KEY_SECURITY_INFORMATION { + PVOID Object; + PSECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PULONG Length; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_QUERY_KEY_SECURITY_INFORMATION, *PREG_QUERY_KEY_SECURITY_INFORMATION; + +typedef struct _REG_SET_KEY_SECURITY_INFORMATION { + PVOID Object; + PSECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_SET_KEY_SECURITY_INFORMATION, *PREG_SET_KEY_SECURITY_INFORMATION; + +typedef struct _REG_RESTORE_KEY_INFORMATION { + PVOID Object; + HANDLE FileHandle; + ULONG Flags; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_RESTORE_KEY_INFORMATION, *PREG_RESTORE_KEY_INFORMATION; + +typedef struct _REG_SAVE_KEY_INFORMATION { + PVOID Object; + HANDLE FileHandle; + ULONG Format; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_SAVE_KEY_INFORMATION, *PREG_SAVE_KEY_INFORMATION; + +typedef struct _REG_REPLACE_KEY_INFORMATION { + PVOID Object; + PUNICODE_STRING OldFileName; + PUNICODE_STRING NewFileName; + PVOID CallContext; + PVOID ObjectContext; + PVOID Reserved; +} REG_REPLACE_KEY_INFORMATION, *PREG_REPLACE_KEY_INFORMATION; + +#endif /* NTDDI_VERSION >= NTDDI_VISTA */ #define SERVICE_KERNEL_DRIVER 0x00000001 #define SERVICE_FILE_SYSTEM_DRIVER 0x00000002 Modified: branches/header-work/include/xdk/exfuncs.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/exfuncs…
============================================================================== --- branches/header-work/include/xdk/exfuncs.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/exfuncs.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -200,7 +200,7 @@ * ExGetCurrentResourceThread( * VOID); */ -#define ExGetCurrentResourceThread() ((ERESOURCE_THREAD)PsGetCurrentThread()) +#define ExGetCurrentResourceThread() ((ULONG_PTR)PsGetCurrentThread()) #define ExReleaseResource(R) (ExReleaseResourceLite(R)) @@ -247,7 +247,7 @@ BOOLEAN NTAPI ExAcquireResourceExclusiveLite( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN BOOLEAN Wait); NTKERNELAPI @@ -261,14 +261,14 @@ BOOLEAN NTAPI ExAcquireSharedStarveExclusive( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN BOOLEAN Wait); NTKERNELAPI BOOLEAN NTAPI ExAcquireSharedWaitForExclusive( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN BOOLEAN Wait); NTKERNELAPI @@ -322,7 +322,7 @@ VOID NTAPI ExConvertExclusiveToSharedLite( - IN PERESOURCE Resource); + IN OUT PERESOURCE Resource); NTKERNELAPI NTSTATUS @@ -349,7 +349,7 @@ NTSTATUS NTAPI ExDeleteResourceLite( - IN PERESOURCE Resource); + IN OUT PERESOURCE Resource); NTKERNELAPI VOID @@ -536,8 +536,8 @@ NTAPI ExNotifyCallback( IN PCALLBACK_OBJECT CallbackObject, - IN PVOID Argument1, - IN PVOID Argument2); + IN PVOID Argument1 OPTIONAL, + IN PVOID Argument2 OPTIONAL); NTKERNELAPI VOID @@ -559,7 +559,7 @@ ExRegisterCallback( IN PCALLBACK_OBJECT CallbackObject, IN PCALLBACK_FUNCTION CallbackFunction, - IN PVOID CallbackContext); + IN PVOID CallbackContext OPTIONAL); NTKERNELAPI NTSTATUS @@ -571,20 +571,20 @@ VOID NTAPI ExReleaseResourceForThreadLite( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN ERESOURCE_THREAD ResourceThreadId); NTKERNELAPI VOID FASTCALL ExReleaseResourceLite( - IN PERESOURCE Resource); + IN OUT PERESOURCE Resource); NTKERNELAPI VOID NTAPI ExSetResourceOwnerPointer( - IN PERESOURCE Resource, + IN OUT PERESOURCE Resource, IN PVOID OwnerPointer); NTKERNELAPI @@ -605,7 +605,7 @@ VOID NTAPI ExUnregisterCallback( - IN PVOID CbRegistration); + IN OUT PVOID CbRegistration); #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ @@ -627,7 +627,7 @@ VOID FASTCALL ExReInitializeRundownProtection( - OUT PEX_RUNDOWN_REF RunRef); + IN OUT PEX_RUNDOWN_REF RunRef); NTKERNELAPI VOID @@ -686,6 +686,87 @@ SIZE_T NTAPI ExSizeOfRundownProtectionCacheAware(VOID); + +NTKERNELAPI +PVOID +NTAPI +ExEnterCriticalRegionAndAcquireResourceShared( + IN OUT PERESOURCE Resource); + +NTKERNELAPI +PVOID +NTAPI +ExEnterCriticalRegionAndAcquireResourceExclusive( + IN OUT PERESOURCE Resource); + +NTKERNELAPI +PVOID +NTAPI +ExEnterCriticalRegionAndAcquireSharedWaitForExclusive( + IN OUT PERESOURCE Resource); + +NTKERNELAPI +VOID +FASTCALL +ExReleaseResourceAndLeaveCriticalRegion( + IN OUT PERESOURCE Resource); + +NTKERNELAPI +VOID +NTAPI +ExInitializeRundownProtectionCacheAware( + OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, + IN SIZE_T RunRefSize); + +NTKERNELAPI +VOID +NTAPI +ExFreeCacheAwareRundownProtection( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); + +NTKERNELAPI +BOOLEAN +FASTCALL +ExAcquireRundownProtectionCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); + +NTKERNELAPI +VOID +FASTCALL +ExReleaseRundownProtectionCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); + +NTKERNELAPI +BOOLEAN +FASTCALL +ExAcquireRundownProtectionCacheAwareEx( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, + IN ULONG Count); + +NTKERNELAPI +VOID +FASTCALL +ExReleaseRundownProtectionCacheAwareEx( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRef, + IN ULONG Count); + +NTKERNELAPI +VOID +FASTCALL +ExWaitForRundownProtectionReleaseCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRef); + +NTKERNELAPI +VOID +FASTCALL +ExReInitializeRundownProtectionCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); + +NTKERNELAPI +VOID +FASTCALL +ExRundownCompletedCacheAware( + IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware); #endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */ @@ -752,6 +833,20 @@ } #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +NTKERNELAPI +VOID +NTAPI +ExSetResourceOwnerPointerEx( + IN OUT PERESOURCE Resource, + IN PVOID OwnerPointer, + IN ULONG Flags); + +#define FLAG_OWNER_POINTER_IS_THREAD 0x1 + +#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ static __inline PVOID ExAllocateFromNPagedLookasideList( Modified: branches/header-work/include/xdk/extypes.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/extypes…
============================================================================== --- branches/header-work/include/xdk/extypes.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/extypes.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -78,10 +78,11 @@ IN OUT PLOOKASIDE_LIST_EX Lookaside); typedef VOID -(NTAPI *PCALLBACK_FUNCTION)( - IN PVOID CallbackContext, - IN PVOID Argument1, - IN PVOID Argument2); +(NTAPI CALLBACK_FUNCTION)( + IN PVOID CallbackContext OPTIONAL, + IN PVOID Argument1 OPTIONAL, + IN PVOID Argument2 OPTIONAL); +typedef CALLBACK_FUNCTION *PCALLBACK_FUNCTION; #define GENERAL_LOOKASIDE_LAYOUT \ union { \ Modified: branches/header-work/include/xdk/iofuncs.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/iofuncs…
============================================================================== --- branches/header-work/include/xdk/iofuncs.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/iofuncs.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -1174,13 +1174,30 @@ NTSTATUS NTAPI IoWMIWriteEvent( - IN PVOID WnodeEventItem); + IN OUT PVOID WnodeEventItem); NTKERNELAPI VOID NTAPI IoWriteErrorLogEntry( IN PVOID ElEntry); + +NTKERNELAPI +PIRP +NTAPI +IoGetTopLevelIrp(VOID); + +NTKERNELAPI +NTSTATUS +NTAPI +IoRegisterLastChanceShutdownNotification( + IN PDEVICE_OBJECT DeviceObject); + +NTKERNELAPI +VOID +NTAPI +IoSetTopLevelIrp( + IN PIRP Irp OPTIONAL); #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ @@ -1218,7 +1235,7 @@ NTAPI IoCsqRemoveNextIrp( IN PIO_CSQ Csq, - IN PVOID PeekContext); + IN PVOID PeekContext OPTIONAL); NTKERNELAPI BOOLEAN @@ -1345,6 +1362,178 @@ IN PVOID ValueBuffer); #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + +#if (NTDDI_VERSION >= NTDDI_WINXPSP1) +NTKERNELAPI +NTSTATUS +NTAPI +IoValidateDeviceIoControlAccess( + IN PIRP Irp, + IN ULONG RequiredAccess); +#endif + +#if (NTDDI_VERSION >= NTDDI_WS03) + +NTKERNELAPI +NTSTATUS +NTAPI +IoCsqInitializeEx( + IN PIO_CSQ Csq, + IN PIO_CSQ_INSERT_IRP_EX CsqInsertIrp, + IN PIO_CSQ_REMOVE_IRP CsqRemoveIrp, + IN PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, + IN PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, + IN PIO_CSQ_RELEASE_LOCK CsqReleaseLock, + IN PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp); + +NTKERNELAPI +NTSTATUS +NTAPI +IoCsqInsertIrpEx( + IN PIO_CSQ Csq, + IN PIRP Irp, + IN PIO_CSQ_IRP_CONTEXT Context OPTIONAL, + IN PVOID InsertContext OPTIONAL); + +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +NTKERNELAPI +NTSTATUS +NTAPI +IoGetBootDiskInformationLite( + OUT PBOOTDISK_INFORMATION_LITE *BootDiskInformation); + +NTKERNELAPI +NTSTATUS +NTAPI +IoCheckShareAccessEx( + IN ACCESS_MASK DesiredAccess, + IN ULONG DesiredShareAccess, + IN OUT PFILE_OBJECT FileObject, + IN OUT PSHARE_ACCESS ShareAccess, + IN BOOLEAN Update, + IN PBOOLEAN WritePermission); + +NTKERNELAPI +NTSTATUS +NTAPI +IoConnectInterruptEx( + IN OUT PIO_CONNECT_INTERRUPT_PARAMETERS Parameters); + +NTKERNELAPI +VOID +NTAPI +IoDisconnectInterruptEx( + IN PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters); + +LOGICAL +NTAPI +IoWithinStackLimits( + IN ULONG_PTR RegionStart, + IN SIZE_T RegionSize); + +NTKERNELAPI +VOID +NTAPI +IoSetShareAccessEx( + IN ACCESS_MASK DesiredAccess, + IN ULONG DesiredShareAccess, + IN OUT PFILE_OBJECT FileObject, + OUT PSHARE_ACCESS ShareAccess, + IN PBOOLEAN WritePermission); + +ULONG +NTAPI +IoSizeofWorkItem(VOID); + +VOID +NTAPI +IoInitializeWorkItem( + IN PVOID IoObject, + IN PIO_WORKITEM IoWorkItem); + +VOID +NTAPI +IoUninitializeWorkItem( + IN PIO_WORKITEM IoWorkItem); + +VOID +NTAPI +IoQueueWorkItemEx( + IN PIO_WORKITEM IoWorkItem, + IN PIO_WORKITEM_ROUTINE_EX WorkerRoutine, + IN WORK_QUEUE_TYPE QueueType, + IN PVOID Context OPTIONAL); + +IO_PRIORITY_HINT +NTAPI +IoGetIoPriorityHint( + IN PIRP Irp); + +NTSTATUS +NTAPI +IoSetIoPriorityHint( + IN PIRP Irp, + IN IO_PRIORITY_HINT PriorityHint); + +NTSTATUS +NTAPI +IoAllocateSfioStreamIdentifier( + IN PFILE_OBJECT FileObject, + IN ULONG Length, + IN PVOID Signature, + OUT PVOID *StreamIdentifier); + +PVOID +NTAPI +IoGetSfioStreamIdentifier( + IN PFILE_OBJECT FileObject, + IN PVOID Signature); + +NTSTATUS +NTAPI +IoFreeSfioStreamIdentifier( + IN PFILE_OBJECT FileObject, + IN PVOID Signature); + +#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ + +#define IoCallDriverStackSafeDefault(a, b) IoCallDriver(a, b) + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +NTKERNELAPI +NTSTATUS +NTAPI +IoGetAffinityInterrupt( + IN PKINTERRUPT InterruptObject, + OUT PGROUP_AFFINITY GroupAffinity); + +NTSTATUS +NTAPI +IoGetContainerInformation( + IN IO_CONTAINER_INFORMATION_CLASS InformationClass, + IN PVOID ContainerObject OPTIONAL, + IN OUT PVOID Buffer OPTIONAL, + IN ULONG BufferLength); + +NTSTATUS +NTAPI +IoRegisterContainerNotification( + IN IO_CONTAINER_NOTIFICATION_CLASS NotificationClass, + IN PIO_CONTAINER_NOTIFICATION_FUNCTION CallbackFunction, + IN PVOID NotificationInformation OPTIONAL, + IN ULONG NotificationInformationLength, + OUT PVOID CallbackRegistration); + +VOID +NTAPI +IoUnregisterContainerNotification( + IN PVOID CallbackRegistration); + +#endif #if defined(_WIN64) NTKERNELAPI @@ -1542,7 +1731,7 @@ FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext( - IN PIRP Irp) + IN OUT PIRP Irp) { PIO_STACK_LOCATION irpSp; PIO_STACK_LOCATION nextIrpSp; @@ -1571,3 +1760,16 @@ return Result; } +#if (NTDDI_VERSION >= NTDDI_WS03) +VOID +FORCEINLINE +IoInitializeThreadedDpcRequest( + IN PDEVICE_OBJECT DeviceObject, + IN PIO_DPC_ROUTINE DpcRoutine) +{ + KeInitializeThreadedDpc(&DeviceObject->Dpc, + (PKDEFERRED_ROUTINE) DpcRoutine, + DeviceObject ); +} +#endif + Modified: branches/header-work/include/xdk/iotypes.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/iotypes…
============================================================================== --- branches/header-work/include/xdk/iotypes.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/iotypes.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -1,6 +1,29 @@ /****************************************************************************** * I/O Manager Types * ******************************************************************************/ + +#define WDM_MAJORVERSION 0x06 +#define WDM_MINORVERSION 0x00 + +#if defined(_WIN64) + +#ifndef USE_DMA_MACROS +#define USE_DMA_MACROS +#endif + +#ifndef NO_LEGACY_DRIVERS +#define NO_LEGACY_DRIVERS +#endif + +#endif /* defined(_WIN64) */ + +#define STATUS_CONTINUE_COMPLETION STATUS_SUCCESS + +#define CONNECT_FULLY_SPECIFIED 0x1 +#define CONNECT_LINE_BASED 0x2 +#define CONNECT_MESSAGE_BASED 0x3 +#define CONNECT_FULLY_SPECIFIED_GROUP 0x4 +#define CONNECT_CURRENT_VERSION 0x4 /* PCI_COMMON_CONFIG.Command */ #define PCI_ENABLE_IO_SPACE 0x0001 @@ -344,11 +367,12 @@ } IO_ALLOCATION_ACTION, *PIO_ALLOCATION_ACTION; typedef IO_ALLOCATION_ACTION -(NTAPI *PDRIVER_CONTROL)( +(NTAPI DRIVER_CONTROL)( IN struct _DEVICE_OBJECT *DeviceObject, IN struct _IRP *Irp, IN PVOID MapRegisterBase, IN PVOID Context); +typedef DRIVER_CONTROL *PDRIVER_CONTROL; typedef struct _WAIT_CONTEXT_BLOCK { KDEVICE_QUEUE_ENTRY WaitQueueEntry; @@ -391,6 +415,153 @@ PVOID Reserved; } DEVICE_OBJECT, *PDEVICE_OBJECT; +typedef enum _IO_SESSION_STATE { + IoSessionStateCreated = 1, + IoSessionStateInitialized, + IoSessionStateConnected, + IoSessionStateDisconnected, + IoSessionStateDisconnectedLoggedOn, + IoSessionStateLoggedOn, + IoSessionStateLoggedOff, + IoSessionStateTerminated, + IoSessionStateMax +} IO_SESSION_STATE, *PIO_SESSION_STATE; + +typedef enum _IO_COMPLETION_ROUTINE_RESULT { + ContinueCompletion = STATUS_CONTINUE_COMPLETION, + StopCompletion = STATUS_MORE_PROCESSING_REQUIRED +} IO_COMPLETION_ROUTINE_RESULT, *PIO_COMPLETION_ROUTINE_RESULT; + +typedef struct _IO_INTERRUPT_MESSAGE_INFO_ENTRY { + PHYSICAL_ADDRESS MessageAddress; + KAFFINITY TargetProcessorSet; + PKINTERRUPT InterruptObject; + ULONG MessageData; + ULONG Vector; + KIRQL Irql; + KINTERRUPT_MODE Mode; + KINTERRUPT_POLARITY Polarity; +} IO_INTERRUPT_MESSAGE_INFO_ENTRY, *PIO_INTERRUPT_MESSAGE_INFO_ENTRY; + +typedef struct _IO_INTERRUPT_MESSAGE_INFO { + KIRQL UnifiedIrql; + ULONG MessageCount; + IO_INTERRUPT_MESSAGE_INFO_ENTRY MessageInfo[1]; +} IO_INTERRUPT_MESSAGE_INFO, *PIO_INTERRUPT_MESSAGE_INFO; + +typedef struct _IO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS { + IN PDEVICE_OBJECT PhysicalDeviceObject; + OUT PKINTERRUPT *InterruptObject; + IN PKSERVICE_ROUTINE ServiceRoutine; + IN PVOID ServiceContext; + IN PKSPIN_LOCK SpinLock OPTIONAL; + IN KIRQL SynchronizeIrql; + IN BOOLEAN FloatingSave; + IN BOOLEAN ShareVector; + IN ULONG Vector; + IN KIRQL Irql; + IN KINTERRUPT_MODE InterruptMode; + IN KAFFINITY ProcessorEnableMask; + IN USHORT Group; +} IO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS, *PIO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS; + +typedef struct _IO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS { + IN PDEVICE_OBJECT PhysicalDeviceObject; + OUT PKINTERRUPT *InterruptObject; + IN PKSERVICE_ROUTINE ServiceRoutine; + IN PVOID ServiceContext; + IN PKSPIN_LOCK SpinLock OPTIONAL; + IN KIRQL SynchronizeIrql OPTIONAL; + IN BOOLEAN FloatingSave; +} IO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS, *PIO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS; + +typedef struct _IO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS { + IN PDEVICE_OBJECT PhysicalDeviceObject; + union { + OUT PVOID *Generic; + OUT PIO_INTERRUPT_MESSAGE_INFO *InterruptMessageTable; + OUT PKINTERRUPT *InterruptObject; + } ConnectionContext; + IN PKMESSAGE_SERVICE_ROUTINE MessageServiceRoutine; + IN PVOID ServiceContext; + IN PKSPIN_LOCK SpinLock OPTIONAL; + IN KIRQL SynchronizeIrql OPTIONAL; + IN BOOLEAN FloatingSave; + IN PKSERVICE_ROUTINE FallBackServiceRoutine OPTIONAL; +} IO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS, *PIO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS; + +typedef struct _IO_CONNECT_INTERRUPT_PARAMETERS { + IN OUT ULONG Version; + union { + IO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS FullySpecified; + IO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS LineBased; + IO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS MessageBased; + }; +} IO_CONNECT_INTERRUPT_PARAMETERS, *PIO_CONNECT_INTERRUPT_PARAMETERS; + +typedef struct _IO_DISCONNECT_INTERRUPT_PARAMETERS { + IN ULONG Version; + union { + IN PVOID Generic; + IN PKINTERRUPT InterruptObject; + IN PIO_INTERRUPT_MESSAGE_INFO InterruptMessageTable; + } ConnectionContext; +} IO_DISCONNECT_INTERRUPT_PARAMETERS, *PIO_DISCONNECT_INTERRUPT_PARAMETERS; + +typedef enum _IO_ACCESS_TYPE { + ReadAccess, + WriteAccess, + ModifyAccess +} IO_ACCESS_TYPE; + +typedef enum _IO_ACCESS_MODE { + SequentialAccess, + RandomAccess +} IO_ACCESS_MODE; + +typedef enum _IO_CONTAINER_NOTIFICATION_CLASS { + IoSessionStateNotification, + IoMaxContainerNotificationClass +} IO_CONTAINER_NOTIFICATION_CLASS; + +typedef struct _IO_SESSION_STATE_NOTIFICATION { + ULONG Size; + ULONG Flags; + PVOID IoObject; + ULONG EventMask; + PVOID Context; +} IO_SESSION_STATE_NOTIFICATION, *PIO_SESSION_STATE_NOTIFICATION; + +typedef enum _IO_CONTAINER_INFORMATION_CLASS { + IoSessionStateInformation, + IoMaxContainerInformationClass +} IO_CONTAINER_INFORMATION_CLASS; + +typedef struct _IO_SESSION_STATE_INFORMATION { + ULONG SessionId; + IO_SESSION_STATE SessionState; + BOOLEAN LocalSession; +} IO_SESSION_STATE_INFORMATION, *PIO_SESSION_STATE_INFORMATION; + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +typedef NTSTATUS +(NTAPI *PIO_CONTAINER_NOTIFICATION_FUNCTION)( + VOID); + +typedef NTSTATUS +(NTAPI IO_SESSION_NOTIFICATION_FUNCTION)( + IN PVOID SessionObject, + IN PVOID IoObject, + IN ULONG Event, + IN PVOID Context, + IN PVOID NotificationPayload, + IN ULONG PayloadLength); + +typedef IO_SESSION_NOTIFICATION_FUNCTION *PIO_SESSION_NOTIFICATION_FUNCTION; + +#endif + typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK * PIO_REMOVE_LOCK_TRACKING_BLOCK; typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK { @@ -427,6 +598,13 @@ IN PDEVICE_OBJECT DeviceObject, IN PVOID Context); typedef IO_WORKITEM_ROUTINE *PIO_WORKITEM_ROUTINE; + +typedef VOID +(NTAPI IO_WORKITEM_ROUTINE_EX)( + IN PVOID IoObject, + IN PVOID Context OPTIONAL, + IN PIO_WORKITEM IoWorkItem); +typedef IO_WORKITEM_ROUTINE_EX *PIO_WORKITEM_ROUTINE_EX; typedef struct _SHARE_ACCESS { ULONG OpenCount; @@ -590,18 +768,6 @@ IoSessionEventMax } IO_SESSION_EVENT, *PIO_SESSION_EVENT; -typedef enum _IO_SESSION_STATE { - IoSessionStateCreated = 1, - IoSessionStateInitialized, - IoSessionStateConnected, - IoSessionStateDisconnected, - IoSessionStateDisconnectedLoggedOn, - IoSessionStateLoggedOn, - IoSessionStateLoggedOff, - IoSessionStateTerminated, - IoSessionStateMax -} IO_SESSION_STATE, *PIO_SESSION_STATE; - #define IO_SESSION_STATE_ALL_EVENTS 0xffffffff #define IO_SESSION_STATE_CREATION_EVENT 0x00000001 #define IO_SESSION_STATE_TERMINATION_EVENT 0x00000002 @@ -618,11 +784,6 @@ ULONG SessionId; BOOLEAN LocalSession; } IO_SESSION_CONNECT_INFO, *PIO_SESSION_CONNECT_INFO; - -typedef VOID -(NTAPI *WMI_NOTIFICATION_CALLBACK)( - PVOID Wnode, - PVOID Context); #define EVENT_INCREMENT 1 #define IO_NO_INCREMENT 0 @@ -658,6 +819,38 @@ BOOLEAN BootDeviceIsGpt; BOOLEAN SystemDeviceIsGpt; } BOOTDISK_INFORMATION_EX, *PBOOTDISK_INFORMATION_EX; + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +typedef struct _LOADER_PARTITION_INFORMATION_EX { + ULONG PartitionStyle; + ULONG PartitionNumber; + union { + ULONG Signature; + GUID DeviceId; + }; + ULONG Flags; +} LOADER_PARTITION_INFORMATION_EX, *PLOADER_PARTITION_INFORMATION_EX; + +typedef struct _BOOTDISK_INFORMATION_LITE { + ULONG NumberEntries; + LOADER_PARTITION_INFORMATION_EX Entries[1]; +} BOOTDISK_INFORMATION_LITE, *PBOOTDISK_INFORMATION_LITE; + +#else + +#if (NTDDI_VERSION >= NTDDI_VISTA) +typedef struct _BOOTDISK_INFORMATION_LITE { + ULONG BootDeviceSignature; + ULONG SystemDeviceSignature; + GUID BootDeviceGuid; + GUID SystemDeviceGuid; + BOOLEAN BootDeviceIsGpt; + BOOLEAN SystemDeviceIsGpt; +} BOOTDISK_INFORMATION_LITE, *PBOOTDISK_INFORMATION_LITE; +#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ + +#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ #include <pshpack1.h> @@ -1192,7 +1385,7 @@ #define FM_LOCK_WAITER_INC (0x4) typedef BOOLEAN -(NTAPI *PFAST_IO_CHECK_IF_POSSIBLE)( +(NTAPI FAST_IO_CHECK_IF_POSSIBLE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -1201,9 +1394,10 @@ IN BOOLEAN CheckForReadOperation, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_CHECK_IF_POSSIBLE *PFAST_IO_CHECK_IF_POSSIBLE; typedef BOOLEAN -(NTAPI *PFAST_IO_READ)( +(NTAPI FAST_IO_READ)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -1212,9 +1406,10 @@ OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_READ *PFAST_IO_READ; typedef BOOLEAN -(NTAPI *PFAST_IO_WRITE)( +(NTAPI FAST_IO_WRITE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -1223,25 +1418,28 @@ IN PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_WRITE *PFAST_IO_WRITE; typedef BOOLEAN -(NTAPI *PFAST_IO_QUERY_BASIC_INFO)( +(NTAPI FAST_IO_QUERY_BASIC_INFO)( IN struct _FILE_OBJECT *FileObject, IN BOOLEAN Wait, OUT PFILE_BASIC_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_QUERY_BASIC_INFO *PFAST_IO_QUERY_BASIC_INFO; typedef BOOLEAN -(NTAPI *PFAST_IO_QUERY_STANDARD_INFO)( +(NTAPI FAST_IO_QUERY_STANDARD_INFO)( IN struct _FILE_OBJECT *FileObject, IN BOOLEAN Wait, OUT PFILE_STANDARD_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_QUERY_STANDARD_INFO *PFAST_IO_QUERY_STANDARD_INFO; typedef BOOLEAN -(NTAPI *PFAST_IO_LOCK)( +(NTAPI FAST_IO_LOCK)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, @@ -1251,9 +1449,10 @@ BOOLEAN ExclusiveLock, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_LOCK *PFAST_IO_LOCK; typedef BOOLEAN -(NTAPI *PFAST_IO_UNLOCK_SINGLE)( +(NTAPI FAST_IO_UNLOCK_SINGLE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, @@ -1261,24 +1460,27 @@ ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_UNLOCK_SINGLE *PFAST_IO_UNLOCK_SINGLE; typedef BOOLEAN -(NTAPI *PFAST_IO_UNLOCK_ALL)( +(NTAPI FAST_IO_UNLOCK_ALL)( IN struct _FILE_OBJECT *FileObject, PEPROCESS ProcessId, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_UNLOCK_ALL *PFAST_IO_UNLOCK_ALL; typedef BOOLEAN -(NTAPI *PFAST_IO_UNLOCK_ALL_BY_KEY)( +(NTAPI FAST_IO_UNLOCK_ALL_BY_KEY)( IN struct _FILE_OBJECT *FileObject, PVOID ProcessId, ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_UNLOCK_ALL_BY_KEY *PFAST_IO_UNLOCK_ALL_BY_KEY; typedef BOOLEAN -(NTAPI *PFAST_IO_DEVICE_CONTROL)( +(NTAPI FAST_IO_DEVICE_CONTROL)( IN struct _FILE_OBJECT *FileObject, IN BOOLEAN Wait, IN PVOID InputBuffer OPTIONAL, @@ -1288,37 +1490,43 @@ IN ULONG IoControlCode, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_DEVICE_CONTROL *PFAST_IO_DEVICE_CONTROL; typedef VOID -(NTAPI *PFAST_IO_ACQUIRE_FILE)( +(NTAPI FAST_IO_ACQUIRE_FILE)( IN struct _FILE_OBJECT *FileObject); +typedef FAST_IO_ACQUIRE_FILE *PFAST_IO_ACQUIRE_FILE; typedef VOID -(NTAPI *PFAST_IO_RELEASE_FILE)( +(NTAPI FAST_IO_RELEASE_FILE)( IN struct _FILE_OBJECT *FileObject); +typedef FAST_IO_RELEASE_FILE *PFAST_IO_RELEASE_FILE; typedef VOID -(NTAPI *PFAST_IO_DETACH_DEVICE)( +(NTAPI FAST_IO_DETACH_DEVICE)( IN struct _DEVICE_OBJECT *SourceDevice, IN struct _DEVICE_OBJECT *TargetDevice); +typedef FAST_IO_DETACH_DEVICE *PFAST_IO_DETACH_DEVICE; typedef BOOLEAN -(NTAPI *PFAST_IO_QUERY_NETWORK_OPEN_INFO)( +(NTAPI FAST_IO_QUERY_NETWORK_OPEN_INFO)( IN struct _FILE_OBJECT *FileObject, IN BOOLEAN Wait, OUT struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, OUT struct _IO_STATUS_BLOCK *IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_QUERY_NETWORK_OPEN_INFO *PFAST_IO_QUERY_NETWORK_OPEN_INFO; typedef NTSTATUS -(NTAPI *PFAST_IO_ACQUIRE_FOR_MOD_WRITE)( +(NTAPI FAST_IO_ACQUIRE_FOR_MOD_WRITE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER EndingOffset, OUT struct _ERESOURCE **ResourceToRelease, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_ACQUIRE_FOR_MOD_WRITE *PFAST_IO_ACQUIRE_FOR_MOD_WRITE; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_READ)( +(NTAPI FAST_IO_MDL_READ)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -1326,15 +1534,17 @@ OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_READ *PFAST_IO_MDL_READ; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_READ_COMPLETE)( +(NTAPI FAST_IO_MDL_READ_COMPLETE)( IN struct _FILE_OBJECT *FileObject, IN PMDL MdlChain, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_READ_COMPLETE *PFAST_IO_MDL_READ_COMPLETE; typedef BOOLEAN -(NTAPI *PFAST_IO_PREPARE_MDL_WRITE)( +(NTAPI FAST_IO_PREPARE_MDL_WRITE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -1342,16 +1552,18 @@ OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_PREPARE_MDL_WRITE *PFAST_IO_PREPARE_MDL_WRITE; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_WRITE_COMPLETE)( +(NTAPI FAST_IO_MDL_WRITE_COMPLETE)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_WRITE_COMPLETE *PFAST_IO_MDL_WRITE_COMPLETE; typedef BOOLEAN -(NTAPI *PFAST_IO_READ_COMPRESSED)( +(NTAPI FAST_IO_READ_COMPRESSED)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -1362,9 +1574,10 @@ OUT struct _COMPRESSED_DATA_INFO *CompressedDataInfo, IN ULONG CompressedDataInfoLength, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_READ_COMPRESSED *PFAST_IO_READ_COMPRESSED; typedef BOOLEAN -(NTAPI *PFAST_IO_WRITE_COMPRESSED)( +(NTAPI FAST_IO_WRITE_COMPRESSED)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, @@ -1375,41 +1588,48 @@ IN struct _COMPRESSED_DATA_INFO *CompressedDataInfo, IN ULONG CompressedDataInfoLength, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_WRITE_COMPRESSED *PFAST_IO_WRITE_COMPRESSED; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_READ_COMPLETE_COMPRESSED)( +(NTAPI FAST_IO_MDL_READ_COMPLETE_COMPRESSED)( IN struct _FILE_OBJECT *FileObject, IN PMDL MdlChain, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_READ_COMPLETE_COMPRESSED *PFAST_IO_MDL_READ_COMPLETE_COMPRESSED; typedef BOOLEAN -(NTAPI *PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED)( +(NTAPI FAST_IO_MDL_WRITE_COMPLETE_COMPRESSED)( IN struct _FILE_OBJECT *FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_MDL_WRITE_COMPLETE_COMPRESSED *PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED; typedef BOOLEAN -(NTAPI *PFAST_IO_QUERY_OPEN)( +(NTAPI FAST_IO_QUERY_OPEN)( IN struct _IRP *Irp, OUT PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_QUERY_OPEN *PFAST_IO_QUERY_OPEN; typedef NTSTATUS -(NTAPI *PFAST_IO_RELEASE_FOR_MOD_WRITE)( +(NTAPI FAST_IO_RELEASE_FOR_MOD_WRITE)( IN struct _FILE_OBJECT *FileObject, IN struct _ERESOURCE *ResourceToRelease, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_RELEASE_FOR_MOD_WRITE *PFAST_IO_RELEASE_FOR_MOD_WRITE; typedef NTSTATUS -(NTAPI *PFAST_IO_ACQUIRE_FOR_CCFLUSH)( +(NTAPI FAST_IO_ACQUIRE_FOR_CCFLUSH)( IN struct _FILE_OBJECT *FileObject, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_ACQUIRE_FOR_CCFLUSH *PFAST_IO_ACQUIRE_FOR_CCFLUSH; typedef NTSTATUS -(NTAPI *PFAST_IO_RELEASE_FOR_CCFLUSH) ( +(NTAPI FAST_IO_RELEASE_FOR_CCFLUSH)( IN struct _FILE_OBJECT *FileObject, IN struct _DEVICE_OBJECT *DeviceObject); +typedef FAST_IO_RELEASE_FOR_CCFLUSH *PFAST_IO_RELEASE_FOR_CCFLUSH; typedef struct _FAST_IO_DISPATCH { ULONG SizeOfFastIoDispatch; @@ -1483,6 +1703,7 @@ #define FO_SKIP_COMPLETION_PORT 0x02000000 #define FO_SKIP_SET_EVENT 0x04000000 #define FO_SKIP_SET_FAST_IO 0x08000000 +#define FO_FLAGS_VALID_ONLY_DURING_CREATE FO_DISALLOW_EXCLUSIVE /* VPB.Flags */ #define VPB_MOUNTED 0x0001 @@ -1497,12 +1718,18 @@ #define SL_FORCE_ACCESS_CHECK 0x01 #define SL_OPEN_PAGING_FILE 0x02 #define SL_OPEN_TARGET_DIRECTORY 0x04 +#define SL_STOP_ON_SYMLINK 0x08 #define SL_CASE_SENSITIVE 0x80 #define SL_KEY_SPECIFIED 0x01 #define SL_OVERRIDE_VERIFY_VOLUME 0x02 #define SL_WRITE_THROUGH 0x04 #define SL_FT_SEQUENTIAL_WRITE 0x08 +#define SL_FORCE_DIRECT_WRITE 0x10 +#define SL_REALTIME_STREAM 0x20 + +#define SL_READ_ACCESS_GRANTED 0x01 +#define SL_WRITE_ACCESS_GRANTED 0x04 #define SL_FAIL_IMMEDIATELY 0x01 #define SL_EXCLUSIVE_LOCK 0x02 @@ -1607,6 +1834,9 @@ #define IRP_MN_QUERY_BUS_INFORMATION 0x15 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16 #define IRP_MN_SURPRISE_REMOVAL 0x17 +#if (NTDDI_VERSION >= NTDDI_WIN7) +#define IRP_MN_DEVICE_ENUMERATED 0x19 +#endif #define IRP_MN_WAIT_WAKE 0x00 #define IRP_MN_POWER_SEQUENCE 0x01 @@ -2143,11 +2373,12 @@ typedef IO_COMPLETION_ROUTINE *PIO_COMPLETION_ROUTINE; typedef VOID -(NTAPI *PIO_DPC_ROUTINE)( +(NTAPI IO_DPC_ROUTINE)( IN struct _KDPC *Dpc, IN struct _DEVICE_OBJECT *DeviceObject, IN struct _IRP *Irp, IN PVOID Context); +typedef IO_DPC_ROUTINE *PIO_DPC_ROUTINE; typedef NTSTATUS (NTAPI *PMM_DLL_INITIALIZE)( @@ -2158,9 +2389,10 @@ VOID); typedef VOID -(NTAPI *PIO_TIMER_ROUTINE)( +(NTAPI IO_TIMER_ROUTINE)( IN struct _DEVICE_OBJECT *DeviceObject, IN PVOID Context); +typedef IO_TIMER_ROUTINE *PIO_TIMER_ROUTINE; typedef struct _IO_SECURITY_CONTEXT { PSECURITY_QUALITY_OF_SERVICE SecurityQos; @@ -2181,6 +2413,13 @@ (NTAPI *PIO_CSQ_INSERT_IRP)( IN struct _IO_CSQ *Csq, IN PIRP Irp); + +typedef NTSTATUS +(NTAPI IO_CSQ_INSERT_IRP_EX)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp, + IN PVOID InsertContext); +typedef IO_CSQ_INSERT_IRP_EX *PIO_CSQ_INSERT_IRP_EX; typedef VOID (NTAPI *PIO_CSQ_REMOVE_IRP)( @@ -2629,3 +2868,18 @@ /* end winnt.h */ +#define WMIREG_ACTION_REGISTER 1 +#define WMIREG_ACTION_DEREGISTER 2 +#define WMIREG_ACTION_REREGISTER 3 +#define WMIREG_ACTION_UPDATE_GUIDS 4 +#define WMIREG_ACTION_BLOCK_IRPS 5 + +#define WMIREGISTER 0 +#define WMIUPDATE 1 + +typedef VOID +(NTAPI FWMI_NOTIFICATION_CALLBACK)( + PVOID Wnode, + PVOID Context); +typedef FWMI_NOTIFICATION_CALLBACK *WMI_NOTIFICATION_CALLBACK; + Modified: branches/header-work/include/xdk/mmfuncs.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/mmfuncs…
============================================================================== --- branches/header-work/include/xdk/mmfuncs.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/mmfuncs.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -80,6 +80,9 @@ ((ULONG) ((((ULONG_PTR) (_Va) & (PAGE_SIZE - 1)) \ + (_Size) + (PAGE_SIZE - 1)) >> PAGE_SHIFT)) +#define COMPUTE_PAGES_SPANNED(Va, Size) \ + ADDRESS_AND_SIZE_TO_SPAN_PAGES(Va,Size) + /* * ULONG * MmGetMdlByteCount( @@ -95,6 +98,8 @@ */ #define MmGetMdlByteOffset(_Mdl) \ ((_Mdl)->ByteOffset) + +#define MmGetMdlBaseVa(Mdl) ((Mdl)->StartVa) /* * PPFN_NUMBER @@ -344,6 +349,17 @@ IN PVOID BaseAddress, IN PMDL MemoryDescriptorList); +NTKERNELAPI +PVOID +NTAPI +MmAllocateContiguousMemorySpecifyCacheNode( + IN SIZE_T NumberOfBytes, + IN PHYSICAL_ADDRESS LowestAcceptableAddress, + IN PHYSICAL_ADDRESS HighestAcceptableAddress, + IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL, + IN MEMORY_CACHING_TYPE CacheType, + IN NODE_REQUIREMENT PreferredNode); + #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ #if (NTDDI_VERSION >= NTDDI_WINXP) @@ -399,7 +415,23 @@ IN ULONG PoolTag, IN PMDL MemoryDescriptorList); +NTKERNELAPI +NTSTATUS +NTAPI +MmAddVerifierThunks( + IN PVOID ThunkBuffer, + IN ULONG ThunkBufferSize); + #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + +#if (NTDDI_VERSION >= NTDDI_WS03) +NTKERNELAPI +LOGICAL +NTAPI +MmIsIoSpaceActive( + IN PHYSICAL_ADDRESS StartAddress, + IN SIZE_T NumberOfBytes); +#endif #if (NTDDI_VERSION >= NTDDI_WS03SP1) NTKERNELAPI @@ -414,3 +446,11 @@ IN ULONG Flags); #endif +#if (NTDDI_VERSION >= NTDDI_VISTA) +NTKERNELAPI +LOGICAL +NTAPI +MmIsDriverVerifyingByAddress( + IN PVOID AddressWithinSection); +#endif + Modified: branches/header-work/include/xdk/mmtypes.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/mmtypes…
============================================================================== --- branches/header-work/include/xdk/mmtypes.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/mmtypes.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -2,12 +2,17 @@ * Memory manager Types * ******************************************************************************/ -#define MM_DONT_ZERO_ALLOCATION 0x00000001 -#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002 -#define MM_ALLOCATE_FULLY_REQUIRED 0x00000004 -#define MM_ALLOCATE_NO_WAIT 0x00000008 -#define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010 -#define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020 +#if (NTDDI_VERSION >= NTDDI_WIN2K) +typedef ULONG NODE_REQUIREMENT; +#define MM_ANY_NODE_OK 0x80000000 +#endif + +#define MM_DONT_ZERO_ALLOCATION 0x00000001 +#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002 +#define MM_ALLOCATE_FULLY_REQUIRED 0x00000004 +#define MM_ALLOCATE_NO_WAIT 0x00000008 +#define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010 +#define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020 #define MDL_MAPPED_TO_SYSTEM_VA 0x0001 #define MDL_PAGES_LOCKED 0x0002 Modified: branches/header-work/include/xdk/psfuncs.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/psfuncs…
============================================================================== --- branches/header-work/include/xdk/psfuncs.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/psfuncs.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -44,3 +44,10 @@ #endif +NTKERNELAPI +NTSTATUS +NTAPI +PsWrapApcWow64Thread( + IN OUT PVOID *ApcContext, + IN OUT PVOID *ApcRoutine); + Modified: branches/header-work/include/xdk/setypes.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/setypes…
============================================================================== --- branches/header-work/include/xdk/setypes.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/setypes.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -209,6 +209,11 @@ UNICODE_STRING ObjectTypeName; } ACCESS_STATE, *PACCESS_STATE; +typedef VOID +(NTAPI *PNTFS_DEREF_EXPORTED_SECURITY_DESCRIPTOR)( + IN PVOID Vcb, + IN PSECURITY_DESCRIPTOR SecurityDescriptor); + #ifndef _NTLSA_IFS_ #ifndef _NTLSA_AUDIT_ Modified: branches/header-work/include/xdk/wdm.template.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/wdm.tem…
============================================================================== --- branches/header-work/include/xdk/wdm.template.h [iso-8859-1] (original) +++ branches/header-work/include/xdk/wdm.template.h [iso-8859-1] Sun Mar 21 00:01:57 2010 @@ -124,7 +124,6 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef struct _HAL_DISPATCH_TABLE *PHAL_DISPATCH_TABLE; typedef struct _HAL_PRIVATE_DISPATCH_TABLE *PHAL_PRIVATE_DISPATCH_TABLE; -typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT; typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT; typedef struct _EPROCESS *PEPROCESS; typedef struct _ETHREAD *PETHREAD; @@ -133,6 +132,14 @@ typedef struct _KPROCESS *PKPROCESS; typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD; typedef struct _CONTEXT *PCONTEXT; + +#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && ( defined(_NTDDK_) || defined(_NTDRIVER_) || defined(_NTOSP_)) +typedef struct _DMA_ADAPTER *PADAPTER_OBJECT; +#elif defined(_WDM_INCLUDED_) +typedef struct _DMA_ADAPTER *PADAPTER_OBJECT; +#else +typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT; +#endif $define (_WDMDDK_) @@ -257,6 +264,9 @@ typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE; #endif +extern PBOOLEAN Mm64BitPhysicalAddress; + +extern PVOID MmBadPointer; #ifdef __cplusplus
14 years, 9 months
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200