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
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
September 2013
----- 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
16 participants
554 discussions
Start a n
N
ew thread
[tkreuzer] 60096: [SMSS] Fix some MSVC warnings.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Sep 14 10:25:59 2013 New Revision: 60096 URL:
http://svn.reactos.org/svn/reactos?rev=60096&view=rev
Log: [SMSS] Fix some MSVC warnings. Modified: trunk/reactos/base/system/smss/pagefile.c trunk/reactos/base/system/smss/smutil.c Modified: trunk/reactos/base/system/smss/pagefile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/pagefile.…
============================================================================== --- trunk/reactos/base/system/smss/pagefile.c [iso-8859-1] (original) +++ trunk/reactos/base/system/smss/pagefile.c [iso-8859-1] Sat Sep 14 10:25:59 2013 @@ -160,10 +160,10 @@ { /* Use the rest of the arguments as a maximum size */ SecondArgument.Buffer = &Arguments.Buffer[i]; - SecondArgument.Length = Arguments.Length - - i * sizeof(WCHAR); - SecondArgument.MaximumLength = Arguments.MaximumLength - - i * sizeof(WCHAR); + SecondArgument.Length = (USHORT)(Arguments.Length - + i * sizeof(WCHAR)); + SecondArgument.MaximumLength = (USHORT)(Arguments.MaximumLength - + i * sizeof(WCHAR)); Status = RtlUnicodeStringToInteger(&SecondArgument, 0, &MaxSize); if (!NT_SUCCESS(Status)) { Modified: trunk/reactos/base/system/smss/smutil.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/smutil.c?…
============================================================================== --- trunk/reactos/base/system/smss/smutil.c [iso-8859-1] (original) +++ trunk/reactos/base/system/smss/smutil.c [iso-8859-1] Sat Sep 14 10:25:59 2013 @@ -213,14 +213,14 @@ if (!Token->Buffer) return STATUS_NO_MEMORY; /* Fill in the unicode string to hold it */ - Token->MaximumLength = TokenLength + sizeof(UNICODE_NULL); - Token->Length = TokenLength; + Token->MaximumLength = (USHORT)(TokenLength + sizeof(UNICODE_NULL)); + Token->Length = (USHORT)TokenLength; RtlCopyMemory(Token->Buffer, p, TokenLength); Token->Buffer[TokenLength / sizeof(WCHAR)] = UNICODE_NULL; } /* Modify the input string with the position of where the next token begins */ - Input->Length -= (ULONG_PTR)pp - (ULONG_PTR)Input->Buffer; + Input->Length -= (USHORT)((ULONG_PTR)pp - (ULONG_PTR)Input->Buffer); Input->Buffer = pp; return STATUS_SUCCESS; } @@ -256,7 +256,7 @@ sizeof(L"\\system32;"); RtlInitEmptyUnicodeString(&FullPathString, RtlAllocateHeap(SmpHeap, SmBaseTag, Length), - Length); + (USHORT)Length); if (FullPathString.Buffer) { /* Append the root, system32;, and then the current library path */ @@ -308,7 +308,7 @@ Length = PAGE_SIZE; RtlInitEmptyUnicodeString(&PathString, RtlAllocateHeap(SmpHeap, SmBaseTag, Length), - Length); + (USHORT)Length); if (!PathString.Buffer) { /* Fail if we have no memory for this */ @@ -329,7 +329,7 @@ Length = PathString.Length + sizeof(UNICODE_NULL); RtlInitEmptyUnicodeString(&PathString, RtlAllocateHeap(SmpHeap, SmBaseTag, Length), - Length); + (USHORT)Length); if (!PathString.Buffer) { /* Fail if we have no memory for this */
11 years, 3 months
1
0
0
0
[tkreuzer] 60095: [KERNEL32] Fix MSVC warnings.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Sep 14 10:20:11 2013 New Revision: 60095 URL:
http://svn.reactos.org/svn/reactos?rev=60095&view=rev
Log: [KERNEL32] Fix MSVC warnings. Modified: trunk/reactos/dll/win32/kernel32/client/console/init.c trunk/reactos/dll/win32/kernel32/client/console/readwrite.c trunk/reactos/dll/win32/kernel32/client/environ.c trunk/reactos/dll/win32/kernel32/client/file/create.c trunk/reactos/dll/win32/kernel32/client/loader.c trunk/reactos/dll/win32/kernel32/client/path.c trunk/reactos/dll/win32/kernel32/client/power.c trunk/reactos/dll/win32/kernel32/client/proc.c trunk/reactos/dll/win32/kernel32/client/thread.c trunk/reactos/dll/win32/kernel32/client/time.c trunk/reactos/dll/win32/kernel32/client/vdm.c trunk/reactos/dll/win32/kernel32/winnls/string/format_msg.c trunk/reactos/dll/win32/kernel32/winnls/string/nls.c Modified: trunk/reactos/dll/win32/kernel32/client/console/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/console/init.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/console/init.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -121,7 +121,7 @@ ConsoleStartInfo->dwStartupFlags = si.dwFlags; if (si.dwFlags & STARTF_USEFILLATTRIBUTE) { - ConsoleStartInfo->wFillAttribute = si.dwFillAttribute; + ConsoleStartInfo->wFillAttribute = (WORD)si.dwFillAttribute; } if (si.dwFlags & STARTF_USECOUNTCHARS) { @@ -134,13 +134,13 @@ } if (si.dwFlags & STARTF_USEPOSITION) { - ConsoleStartInfo->dwWindowOrigin.X = (LONG)(si.dwX); - ConsoleStartInfo->dwWindowOrigin.Y = (LONG)(si.dwY); + ConsoleStartInfo->dwWindowOrigin.X = (SHORT)(si.dwX); + ConsoleStartInfo->dwWindowOrigin.Y = (SHORT)(si.dwY); } if (si.dwFlags & STARTF_USESIZE) { - ConsoleStartInfo->dwWindowSize.X = (LONG)(si.dwXSize); - ConsoleStartInfo->dwWindowSize.Y = (LONG) (si.dwYSize); + ConsoleStartInfo->dwWindowSize.X = (SHORT)(si.dwXSize); + ConsoleStartInfo->dwWindowSize.Y = (SHORT)(si.dwYSize); } /* Set up the title for the console */ Modified: trunk/reactos/dll/win32/kernel32/client/console/readwrite.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/console/readwrite.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -660,7 +660,7 @@ WriteOutputCodeRequest->CodeType = CodeType; WriteOutputCodeRequest->Coord = dwWriteCoord; - WriteOutputCodeRequest->Length = nLength; + WriteOutputCodeRequest->Length = (USHORT)nLength; /* Call the server */ Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, Modified: trunk/reactos/dll/win32/kernel32/client/environ.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/environ.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/environ.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -50,7 +50,7 @@ if (nSize) { /* Keep the given size, minus a NULL-char */ - UniSize = nSize - 1; + UniSize = (USHORT)(nSize - 1); } else { @@ -114,7 +114,7 @@ { /* Check if the size is too big to fit */ UniSize = UNICODE_STRING_MAX_BYTES - 1; - if (nSize <= UniSize) UniSize = nSize; + if (nSize <= UniSize) UniSize = (USHORT)nSize; /* Check the size */ Result = RtlUnicodeStringToAnsiSize(&VarValueU); @@ -169,7 +169,7 @@ { if (nSize) { - UniSize = nSize * sizeof(WCHAR) - sizeof(UNICODE_NULL); + UniSize = (USHORT)nSize * sizeof(WCHAR) - sizeof(UNICODE_NULL); } else { @@ -180,7 +180,7 @@ { UniSize = UNICODE_STRING_MAX_BYTES - sizeof(UNICODE_NULL); } - + Status = RtlInitUnicodeStringEx(&VarName, lpName); if (!NT_SUCCESS(Status)) { @@ -404,11 +404,11 @@ /* Check if the size is too big to fit */ UniSize = UNICODE_STRING_MAX_CHARS - 2; - if (nSize <= UniSize) UniSize = nSize; - + if (nSize <= UniSize) UniSize = (USHORT)nSize; + /* Clear the input buffer */ if (lpDst) *lpDst = ANSI_NULL; - + /* Initialize all the strings */ RtlInitAnsiString(&Source, lpSrc); RtlInitUnicodeString(&SourceU, NULL); @@ -446,7 +446,7 @@ if (!(NT_SUCCESS(Status)) && (Status == STATUS_BUFFER_TOO_SMALL)) { /* Fixup the length that the API returned */ - DestU.MaximumLength = Length; + DestU.MaximumLength = (SHORT)Length; /* Free old Unicode buffer */ RtlFreeHeap(RtlGetProcessHeap(), 0, DestU.Buffer); @@ -474,7 +474,7 @@ { /* Check if the size is too big to fit */ UniSize = UNICODE_STRING_MAX_BYTES - 1; - if (nSize <= UniSize) UniSize = nSize; + if (nSize <= UniSize) UniSize = (USHORT)nSize; /* Check the size */ Result = RtlUnicodeStringToAnsiSize(&DestU); @@ -483,7 +483,7 @@ /* Convert the string */ RtlInitEmptyAnsiString(&Dest, lpDst, UniSize); Status = RtlUnicodeStringToAnsiString(&Dest, &DestU, FALSE); - + /* Write a NULL-char in case of failure only */ if (!NT_SUCCESS(Status)) *lpDst = ANSI_NULL; } @@ -517,13 +517,13 @@ UNICODE_STRING Source, Destination; NTSTATUS Status; USHORT UniSize; - + UniSize = UNICODE_STRING_MAX_CHARS - 2; - if (nSize <= UniSize) UniSize = nSize; + if (nSize <= UniSize) UniSize = (USHORT)nSize; RtlInitUnicodeString(&Source, (LPWSTR)lpSrc); RtlInitEmptyUnicodeString(&Destination, lpDst, UniSize * sizeof(WCHAR)); - + Status = RtlExpandEnvironmentStrings_U(NULL, &Source, &Destination, Modified: trunk/reactos/dll/win32/kernel32/client/file/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/create.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/create.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -418,7 +418,7 @@ lpReOpenBuff->szPathName, NULL)) { - lpReOpenBuff->nErrCode = GetLastError(); + lpReOpenBuff->nErrCode = (WORD)GetLastError(); return HFILE_ERROR; } @@ -492,7 +492,7 @@ if (Len == 0 || Len > OFS_MAXPATHNAME) { - lpReOpenBuff->nErrCode = GetLastError(); + lpReOpenBuff->nErrCode = (WORD)GetLastError(); return (HFILE)INVALID_HANDLE_VALUE; } @@ -500,7 +500,7 @@ { if (!DeleteFileW(PathNameW)) { - lpReOpenBuff->nErrCode = GetLastError(); + lpReOpenBuff->nErrCode = (WORD)GetLastError(); return HFILE_ERROR; } TRACE("(%s): OF_DELETE return = OK\n", lpFileName); @@ -546,7 +546,7 @@ RtlFreeHeap(RtlGetProcessHeap(), 0, FileNameString.Buffer); - lpReOpenBuff->nErrCode = RtlNtStatusToDosError(errCode); + lpReOpenBuff->nErrCode = (WORD)RtlNtStatusToDosError(errCode); if (!NT_SUCCESS(errCode)) { Modified: trunk/reactos/dll/win32/kernel32/client/loader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/loader.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/loader.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -552,7 +552,7 @@ } /* Call unicode API */ - FilenameW.Length = GetModuleFileNameW(hModule, FilenameW.Buffer, nSize) * sizeof(WCHAR); + FilenameW.Length = (USHORT)GetModuleFileNameW(hModule, FilenameW.Buffer, nSize) * sizeof(WCHAR); FilenameW.MaximumLength = FilenameW.Length + sizeof(WCHAR); if (FilenameW.Length) Modified: trunk/reactos/dll/win32/kernel32/client/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -557,7 +557,7 @@ IN ULONG Length) { BOOLEAN HasExtension; - WCHAR c; + UCHAR c; NTSTATUS Status; UNICODE_STRING UnicodeName; ANSI_STRING AnsiName; @@ -587,7 +587,7 @@ /* Initialize our two strings */ RtlInitEmptyAnsiString(&AnsiName, AnsiBuffer, MAX_PATH); - RtlInitEmptyUnicodeString(&UnicodeName, Name, Length * sizeof(WCHAR)); + RtlInitEmptyUnicodeString(&UnicodeName, Name, (USHORT)Length * sizeof(WCHAR)); UnicodeName.Length = UnicodeName.MaximumLength; /* Now do the conversion */ @@ -914,7 +914,7 @@ ANSI_STRING AnsiDllDirectory; ULONG Length; - RtlInitEmptyAnsiString(&AnsiDllDirectory, lpBuffer, nBufferLength); + RtlInitEmptyAnsiString(&AnsiDllDirectory, lpBuffer, (USHORT)nBufferLength); RtlEnterCriticalSection(&BaseDllDirectoryLock); @@ -1363,7 +1363,7 @@ } /* Set the path size now that we have it */ - PathString.MaximumLength = PathString.Length = LengthNeeded * sizeof(WCHAR); + PathString.MaximumLength = PathString.Length = (USHORT)LengthNeeded * sizeof(WCHAR); /* Request SxS isolation from RtlDosSearchPath_Ustr */ Flags |= 1; @@ -1377,7 +1377,7 @@ if (nBufferLength <= UNICODE_STRING_MAX_CHARS) { /* Add it into the string */ - CallerBuffer.MaximumLength = nBufferLength * sizeof(WCHAR); + CallerBuffer.MaximumLength = (USHORT)nBufferLength * sizeof(WCHAR); } else { @@ -1707,9 +1707,9 @@ if (!PathLength) goto Quickie; - ShortPathUni.MaximumLength = PathLength * sizeof(WCHAR) + sizeof(UNICODE_NULL); + ShortPathUni.MaximumLength = (USHORT)PathLength * sizeof(WCHAR) + sizeof(UNICODE_NULL); LongPathUni.Buffer = LongPath; - LongPathUni.Length = PathLength * sizeof(WCHAR); + LongPathUni.Length = (USHORT)PathLength * sizeof(WCHAR); Status = BasepUnicodeStringTo8BitString(&LongPathAnsi, &LongPathUni, TRUE); if (!NT_SUCCESS(Status)) @@ -1788,9 +1788,9 @@ if (!PathLength) goto Quickie; - LongPathUni.MaximumLength = PathLength * sizeof(WCHAR) + sizeof(UNICODE_NULL); + LongPathUni.MaximumLength = (USHORT)PathLength * sizeof(WCHAR) + sizeof(UNICODE_NULL); ShortPathUni.Buffer = ShortPath; - ShortPathUni.Length = PathLength * sizeof(WCHAR); + ShortPathUni.Length = (USHORT)PathLength * sizeof(WCHAR); Status = BasepUnicodeStringTo8BitString(&ShortPathAnsi, &ShortPathUni, TRUE); if (!NT_SUCCESS(Status)) @@ -2150,8 +2150,8 @@ MaxLength = UNICODE_STRING_MAX_BYTES - 1; } - StaticString->Length = RtlGetCurrentDirectory_U(StaticString->MaximumLength, - StaticString->Buffer); + StaticString->Length = (USHORT)RtlGetCurrentDirectory_U(StaticString->MaximumLength, + StaticString->Buffer); Status = RtlUnicodeToMultiByteSize(&nBufferLength, StaticString->Buffer, StaticString->Length); @@ -2167,7 +2167,7 @@ } AnsiString.Buffer = lpBuffer; - AnsiString.MaximumLength = MaxLength; + AnsiString.MaximumLength = (USHORT)MaxLength; Status = BasepUnicodeStringTo8BitString(&AnsiString, StaticString, FALSE); if (!NT_SUCCESS(Status)) { Modified: trunk/reactos/dll/win32/kernel32/client/power.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/power.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/power.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -53,7 +53,7 @@ { if (Current <= Max) { - PowerStatus->BatteryLifePercent = (100 * Current + Max / 2) / Max; + PowerStatus->BatteryLifePercent = (UCHAR)((100 * Current + Max / 2) / Max); } else { Modified: trunk/reactos/dll/win32/kernel32/client/proc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -102,7 +102,7 @@ /* Allocate buffer for the output string */ Length = CommandLineString.MaximumLength + ApplicationNameString.MaximumLength + 32; Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length); - RtlInitEmptyUnicodeString(SubsysCommandLine, Buffer, Length); + RtlInitEmptyUnicodeString(SubsysCommandLine, Buffer, (USHORT)Length); if (!Buffer) { /* Fail, no memory */ @@ -2295,7 +2295,8 @@ SECTION_IMAGE_INFORMATION ImageInformation; IO_STATUS_BLOCK IoStatusBlock; CLIENT_ID ClientId; - ULONG NoWindow, RegionSize, StackSize, ImageMachine, ErrorCode, Flags; + ULONG NoWindow, RegionSize, StackSize, ErrorCode, Flags; + USHORT ImageMachine; ULONG ParameterFlags, PrivilegeValue, HardErrorMode, ErrorResponse; ULONG_PTR ErrorParameters[2]; BOOLEAN InJob, SaferNeeded, UseLargePages, HavePrivilege; @@ -2576,7 +2577,7 @@ } /* Use the allocated size and convert */ - UnicodeEnv.MaximumLength = RegionSize; + UnicodeEnv.MaximumLength = (USHORT)RegionSize; Status = RtlAnsiStringToUnicodeString(&UnicodeEnv, &AnsiEnv, FALSE); if (!NT_SUCCESS(Status)) { @@ -3784,7 +3785,7 @@ /* Set the length */ RtlInitEmptyUnicodeString(&DebuggerString, DebuggerString.Buffer, - n); + (USHORT)n); /* Now perform the command line creation */ ImageDbgStatus = RtlAppendUnicodeToString(&DebuggerString, Modified: trunk/reactos/dll/win32/kernel32/client/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/thread.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/thread.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -920,7 +920,7 @@ SetThreadUILanguage(IN LANGID LangId) { UNIMPLEMENTED; - return NtCurrentTeb()->CurrentLocale; + return (LANGID)NtCurrentTeb()->CurrentLocale; } /* Modified: trunk/reactos/dll/win32/kernel32/client/time.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/time.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/time.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -531,7 +531,7 @@ PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION ProcPerfInfo; LARGE_INTEGER TotalUserTime, TotalKernTime, TotalIdleTime; SIZE_T BufferSize, ReturnLength; - ULONG i; + CCHAR i; NTSTATUS Status; TotalUserTime.QuadPart = TotalKernTime.QuadPart = TotalIdleTime.QuadPart = 0; Modified: trunk/reactos/dll/win32/kernel32/client/vdm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/vdm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/vdm.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -382,8 +382,8 @@ /* Initialize the unicode string to hold it */ EnvironmentSize = (p - NewEnvironment) * sizeof(WCHAR); - RtlInitEmptyUnicodeString(UnicodeEnv, NewEnvironment, EnvironmentSize); - UnicodeEnv->Length = EnvironmentSize; + RtlInitEmptyUnicodeString(UnicodeEnv, NewEnvironment, (USHORT)EnvironmentSize); + UnicodeEnv->Length = (USHORT)EnvironmentSize; /* Create the ASCII version of it */ Status = RtlUnicodeStringToAnsiString(AnsiEnv, UnicodeEnv, TRUE); Modified: trunk/reactos/dll/win32/kernel32/winnls/string/format_msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/winnls/string/format_msg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/winnls/string/format_msg.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -212,7 +212,7 @@ (unicode_caller && format[0] == 'C') || (!unicode_caller && format[0] == 'c')) { - char ch = arg; + char ch = (char)arg; wstring = HeapAlloc( GetProcessHeap(), 0, 2 * sizeof(WCHAR) ); MultiByteToWideChar( CP_ACP, 0, &ch, 1, wstring, 1 ); wstring[1] = 0; @@ -446,9 +446,9 @@ else if (dwFlags & (FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM)) { if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE) - from = load_message( (HMODULE)lpSource, dwMessageId, dwLanguageId ); + from = load_message( (HMODULE)lpSource, dwMessageId, (WORD)dwLanguageId ); if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)) - from = load_message( kernel32_handle, dwMessageId, dwLanguageId ); + from = load_message( kernel32_handle, dwMessageId, (WORD)dwLanguageId ); if (!from) return 0; } else @@ -549,9 +549,9 @@ else if (dwFlags & (FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM)) { if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE) - from = load_message( (HMODULE)lpSource, dwMessageId, dwLanguageId ); + from = load_message( (HMODULE)lpSource, dwMessageId, (WORD)dwLanguageId ); if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)) - from = load_message( kernel32_handle, dwMessageId, dwLanguageId ); + from = load_message( kernel32_handle, dwMessageId, (WORD)dwLanguageId ); if (!from) return 0; } else Modified: trunk/reactos/dll/win32/kernel32/winnls/string/nls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] Sat Sep 14 10:20:11 2013 @@ -551,10 +551,10 @@ static INT -WINAPI -IntMultiByteToWideCharSYMBOL(DWORD Flags, +WINAPI +IntMultiByteToWideCharSYMBOL(DWORD Flags, LPCSTR MultiByteString, - INT MultiByteCount, + INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount) { @@ -569,7 +569,7 @@ return 0; } - if (WideCharCount == 0) + if (WideCharCount == 0) { return MultiByteCount; } @@ -588,7 +588,7 @@ WideCharString[Count] = Char + 0xf000; } } - if (MultiByteCount > WideCharMaxLen) + if (MultiByteCount > WideCharMaxLen) { SetLastError(ERROR_INSUFFICIENT_BUFFER); return 0; @@ -624,7 +624,7 @@ } - if (MultiByteCount == 0) + if (MultiByteCount == 0) { return WideCharCount; } @@ -635,11 +635,11 @@ Char = WideCharString[Count]; if (Char < 0x20) { - MultiByteString[Count] = Char; - } - else - { - if ((Char>=0xf020)&&(Char<0xf100)) + MultiByteString[Count] = (CHAR)Char; + } + else + { + if ((Char >= 0xf020) && (Char < 0xf100)) { MultiByteString[Count] = Char - 0xf000; } @@ -650,7 +650,8 @@ } } } - if (WideCharCount > MaxLen) + + if (WideCharCount > MaxLen) { SetLastError(ERROR_INSUFFICIENT_BUFFER); return 0; @@ -1013,7 +1014,7 @@ if (DefaultChar) DefChar = *DefaultChar; else - DefChar = CodePageTable->TransDefaultChar; + DefChar = (CHAR)CodePageTable->TransDefaultChar; /* Convert the WideCharString to the MultiByteString and verify if the mapping is valid */ for (TempLength = MultiByteCount; @@ -1259,16 +1260,16 @@ return GetCPFileNameFromRegistry(CodePage, NULL, 0); } -static const signed char -base64inv[] = -{ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +static const signed char +base64inv[] = +{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 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, -1, -1, -1, -1, -1, - -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + -1, 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, -1, -1, -1, -1, -1 }; @@ -1334,7 +1335,7 @@ } cchUtf7--; pch = pszUtf7; - while(cchUtf7 > 0 && (BYTE) *pszUtf7 < 0x80 && + while(cchUtf7 > 0 && (BYTE) *pszUtf7 < 0x80 && base64inv[*pszUtf7] >= 0) { cchUtf7--; @@ -1390,7 +1391,7 @@ } cchUtf7--; pch = pszUtf7; - while(cchUtf7 > 0 && (BYTE) *pszUtf7 < 0x80 && + while(cchUtf7 > 0 && (BYTE) *pszUtf7 < 0x80 && base64inv[*pszUtf7] >= 0) { cchUtf7--; @@ -2166,5 +2167,5 @@ STUB; return TRUE; } - + /* EOF */
11 years, 3 months
1
0
0
0
[akhaldi] 60094: [D3DXOF] * Import from Wine 1.7.1.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 14 10:13:29 2013 New Revision: 60094 URL:
http://svn.reactos.org/svn/reactos?rev=60094&view=rev
Log: [D3DXOF] * Import from Wine 1.7.1. Added: trunk/reactos/dll/directx/wine/d3dxof/ (with props) trunk/reactos/dll/directx/wine/d3dxof/CMakeLists.txt (with props) trunk/reactos/dll/directx/wine/d3dxof/d3dxof.c (with props) trunk/reactos/dll/directx/wine/d3dxof/d3dxof.idl (with props) trunk/reactos/dll/directx/wine/d3dxof/d3dxof.spec (with props) trunk/reactos/dll/directx/wine/d3dxof/d3dxof_private.h (with props) trunk/reactos/dll/directx/wine/d3dxof/main.c (with props) trunk/reactos/dll/directx/wine/d3dxof/mszip.c (with props) trunk/reactos/dll/directx/wine/d3dxof/mszip.h (with props) trunk/reactos/dll/directx/wine/d3dxof/parsing.c (with props) trunk/reactos/dll/directx/wine/d3dxof/version.rc (with props) Modified: trunk/reactos/dll/directx/wine/CMakeLists.txt trunk/reactos/include/dxsdk/dxfile.h trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/directx/wine/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/CMakeList…
Added: trunk/reactos/dll/directx/wine/d3dxof/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/CM…
Added: trunk/reactos/dll/directx/wine/d3dxof/d3dxof.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/d3…
Added: trunk/reactos/dll/directx/wine/d3dxof/d3dxof.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/d3…
Added: trunk/reactos/dll/directx/wine/d3dxof/d3dxof.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/d3…
Added: trunk/reactos/dll/directx/wine/d3dxof/d3dxof_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/d3…
Added: trunk/reactos/dll/directx/wine/d3dxof/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/ma…
Added: trunk/reactos/dll/directx/wine/d3dxof/mszip.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/ms…
Added: trunk/reactos/dll/directx/wine/d3dxof/mszip.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/ms…
Added: trunk/reactos/dll/directx/wine/d3dxof/parsing.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/pa…
Added: trunk/reactos/dll/directx/wine/d3dxof/version.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3dxof/ve…
Modified: trunk/reactos/include/dxsdk/dxfile.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/dxsdk/dxfile.h?rev…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
11 years, 3 months
1
0
0
0
[tfaber] 60093: [KERNEL32] - Fix an off-by-one in the UNC case in WaitNamedPipeW - Some readability
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Sep 14 09:12:12 2013 New Revision: 60093 URL:
http://svn.reactos.org/svn/reactos?rev=60093&view=rev
Log: [KERNEL32] - Fix an off-by-one in the UNC case in WaitNamedPipeW - Some readability Modified: trunk/reactos/dll/win32/kernel32/client/file/npipe.c Modified: trunk/reactos/dll/win32/kernel32/client/file/npipe.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/npipe.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/npipe.c [iso-8859-1] Sat Sep 14 09:12:12 2013 @@ -415,8 +415,9 @@ } /* Move past it */ - NewName.Buffer += 9; - NewName.Length -= 9 * sizeof(WCHAR); + NewName.Buffer += PipePrefix.Length / sizeof(WCHAR); + NewName.Length -= PipePrefix.Length; + NewName.MaximumLength -= PipePrefix.Length; /* Initialize the Dos Devices name */ TRACE("NewName: %wZ\n", &NewName); @@ -438,10 +439,10 @@ } while (*p); /* Now make sure the full name contains "pipe\" */ - if ((*p) && !(_wcsnicmp(p + 1, L"pipe\\", sizeof("pipe\\")))) + if ((*p) && !(_wcsnicmp(p + 1, L"pipe\\", sizeof("pipe\\") - sizeof(ANSI_NULL)))) { /* Get to the pipe name itself now */ - p += sizeof("pipe\\") - 1; + p += sizeof("pipe\\") - sizeof(ANSI_NULL); } else {
11 years, 3 months
1
0
0
0
[akhaldi] 60092: [WPP] * Sync with Wine 1.7.1.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Sep 14 09:02:13 2013 New Revision: 60092 URL:
http://svn.reactos.org/svn/reactos?rev=60092&view=rev
Log: [WPP] * Sync with Wine 1.7.1. Added: trunk/reactos/tools/wpp/ppl.yy.c - copied, changed from r59998, trunk/reactos/tools/wpp/lex.yy.c Removed: trunk/reactos/tools/wpp/lex.yy.c Modified: trunk/reactos/include/reactos/wine/wpp.h trunk/reactos/media/doc/README.WINE trunk/reactos/tools/wpp/CMakeLists.txt trunk/reactos/tools/wpp/ppl.l trunk/reactos/tools/wpp/ppy.tab.c trunk/reactos/tools/wpp/ppy.tab.h trunk/reactos/tools/wpp/ppy.y trunk/reactos/tools/wpp/preproc.c trunk/reactos/tools/wpp/wpp.c trunk/reactos/tools/wpp/wpp_private.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/include/reactos/wine/wpp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/wpp.h…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
Modified: trunk/reactos/tools/wpp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/CMakeLists.txt?r…
Removed: trunk/reactos/tools/wpp/lex.yy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/lex.yy.c?rev=600…
Modified: trunk/reactos/tools/wpp/ppl.l URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/ppl.l?rev=60092&…
Copied: trunk/reactos/tools/wpp/ppl.yy.c (from r59998, trunk/reactos/tools/wpp/lex.yy.c) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/ppl.yy.c?p2=trun…
Modified: trunk/reactos/tools/wpp/ppy.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/ppy.tab.c?rev=60…
Modified: trunk/reactos/tools/wpp/ppy.tab.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/ppy.tab.h?rev=60…
Modified: trunk/reactos/tools/wpp/ppy.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/ppy.y?rev=60092&…
Modified: trunk/reactos/tools/wpp/preproc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/preproc.c?rev=60…
Modified: trunk/reactos/tools/wpp/wpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/wpp.c?rev=60092&…
Modified: trunk/reactos/tools/wpp/wpp_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wpp/wpp_private.h?re…
11 years, 3 months
1
0
0
0
[akhaldi] 60091: [DDRAW] * Remove some now unneeded source files.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 13 23:56:46 2013 New Revision: 60091 URL:
http://svn.reactos.org/svn/reactos?rev=60091&view=rev
Log: [DDRAW] * Remove some now unneeded source files. Removed: trunk/reactos/dll/directx/wine/ddraw/legacy.h trunk/reactos/dll/directx/wine/ddraw/stubs.c Removed: trunk/reactos/dll/directx/wine/ddraw/legacy.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/leg…
============================================================================== --- trunk/reactos/dll/directx/wine/ddraw/legacy.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/ddraw/legacy.h (removed) @@ -1,130 +0,0 @@ -/* -* Copyright (C) the Wine project -* -* 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 -*/ - - -#ifdef __cplusplus -extern "C" { -#endif - - /***************************************************************************** - * IDirectDraw3 interface - */ - -#if defined( _WIN32 ) && !defined( _NO_COM ) - #define INTERFACE IDirectDraw3 - DECLARE_INTERFACE_(IDirectDraw3,IUnknown) - { - /*** IUnknown methods ***/ - /*00*/ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - /*04*/ STDMETHOD_(ULONG,AddRef)(THIS) PURE; - /*08*/ STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectDraw2 methods ***/ - /*0c*/ STDMETHOD(Compact)(THIS) PURE; - /*10*/ STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER *lplpDDClipper, IUnknown *pUnkOuter) PURE; - /*14*/ STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE *lplpDDPalette, IUnknown *pUnkOuter) PURE; - /*18*/ STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE *lplpDDSurface, IUnknown *pUnkOuter) PURE; - /*1c*/ STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE *lplpDupDDSurface) PURE; - /*20*/ STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE; - /*24*/ STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; - /*28*/ STDMETHOD(FlipToGDISurface)(THIS) PURE; - /*2c*/ STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; - /*30*/ STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; - /*34*/ STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; - /*38*/ STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE *lplpGDIDDSurface) PURE; - /*3c*/ STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; - /*40*/ STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; - /*44*/ STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL *lpbIsInVB) PURE; - /*48*/ STDMETHOD(Initialize)(THIS_ GUID *lpGUID) PURE; - /*4c*/ STDMETHOD(RestoreDisplayMode)(THIS) PURE; - /*50*/ STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; - /*54*/ STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE; - /*58*/ STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; - /* added in v2 */ - /*5c*/ STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE; - /* added in v3 */ - /*60*/ STDMETHOD(GetSurfaceFromDC)(THIS_ HDC hdc, LPDIRECTDRAWSURFACE *pSurf) PURE; - }; - #undef INTERFACE - - #if !defined(__cplusplus) || defined(CINTERFACE) - /*** IUnknown methods ***/ - #define IDirectDraw3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) - #define IDirectDraw3_AddRef(p) (p)->lpVtbl->AddRef(p) - #define IDirectDraw3_Release(p) (p)->lpVtbl->Release(p) - /*** IDirectDraw methods ***/ - #define IDirectDraw3_Compact(p) (p)->lpVtbl->Compact(p) - #define IDirectDraw3_CreateClipper(p,a,b,c) (p)->lpVtbl->CreateClipper(p,a,b,c) - #define IDirectDraw3_CreatePalette(p,a,b,c,d) (p)->lpVtbl->CreatePalette(p,a,b,c,d) - #define IDirectDraw3_CreateSurface(p,a,b,c) (p)->lpVtbl->CreateSurface(p,a,b,c) - #define IDirectDraw3_DuplicateSurface(p,a,b) (p)->lpVtbl->DuplicateSurface(p,a,b) - #define IDirectDraw3_EnumDisplayModes(p,a,b,c,d) (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d) - #define IDirectDraw3_EnumSurfaces(p,a,b,c,d) (p)->lpVtbl->EnumSurfaces(p,a,b,c,d) - #define IDirectDraw3_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) - #define IDirectDraw3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) - #define IDirectDraw3_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) - #define IDirectDraw3_GetFourCCCodes(p,a,b) (p)->lpVtbl->GetFourCCCodes(p,a,b) - #define IDirectDraw3_GetGDISurface(p,a) (p)->lpVtbl->GetGDISurface(p,a) - #define IDirectDraw3_GetMonitorFrequency(p,a) (p)->lpVtbl->GetMonitorFrequency(p,a) - #define IDirectDraw3_GetScanLine(p,a) (p)->lpVtbl->GetScanLine(p,a) - #define IDirectDraw3_GetVerticalBlankStatus(p,a) (p)->lpVtbl->GetVerticalBlankStatus(p,a) - #define IDirectDraw3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) - #define IDirectDraw3_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) - #define IDirectDraw3_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) - #define IDirectDraw3_SetDisplayMode(p,a,b,c,d,e) (p)->lpVtbl->SetDisplayMode(p,a,b,c,d,e) - #define IDirectDraw3_WaitForVerticalBlank(p,a,b) (p)->lpVtbl->WaitForVerticalBlank(p,a,b) - /*** IDirectDraw2 methods ***/ - #define IDirectDraw3_GetAvailableVidMem(p,a,b,c) (p)->lpVtbl->GetAvailableVidMem(p,a,b,c) - /*** IDirectDraw3 methods ***/ - #define IDirectDraw3_GetSurfaceFromDC(p,a,b) (p)->lpVtbl->GetSurfaceFromDC(p,a,b) - #else - /*** IUnknown methods ***/ - #define IDirectDraw3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) - #define IDirectDraw3_AddRef(p) (p)->AddRef() - #define IDirectDraw3_Release(p) (p)->Release() - /*** IDirectDraw methods ***/ - #define IDirectDraw3_Compact(p) (p)->Compact() - #define IDirectDraw3_CreateClipper(p,a,b,c) (p)->CreateClipper(a,b,c) - #define IDirectDraw3_CreatePalette(p,a,b,c,d) (p)->CreatePalette(a,b,c,d) - #define IDirectDraw3_CreateSurface(p,a,b,c) (p)->CreateSurface(a,b,c) - #define IDirectDraw3_DuplicateSurface(p,a,b) (p)->DuplicateSurface(a,b) - #define IDirectDraw3_EnumDisplayModes(p,a,b,c,d) (p)->EnumDisplayModes(a,b,c,d) - #define IDirectDraw3_EnumSurfaces(p,a,b,c,d) (p)->EnumSurfaces(a,b,c,d) - #define IDirectDraw3_FlipToGDISurface(p) (p)->FlipToGDISurface() - #define IDirectDraw3_GetCaps(p,a,b) (p)->GetCaps(a,b) - #define IDirectDraw3_GetDisplayMode(p,a) (p)->GetDisplayMode(a) - #define IDirectDraw3_GetFourCCCodes(p,a,b) (p)->GetFourCCCodes(a,b) - #define IDirectDraw3_GetGDISurface(p,a) (p)->GetGDISurface(a) - #define IDirectDraw3_GetMonitorFrequency(p,a) (p)->GetMonitorFrequency(a) - #define IDirectDraw3_GetScanLine(p,a) (p)->GetScanLine(a) - #define IDirectDraw3_GetVerticalBlankStatus(p,a) (p)->GetVerticalBlankStatus(a) - #define IDirectDraw3_Initialize(p,a) (p)->Initialize(a) - #define IDirectDraw3_RestoreDisplayMode(p) (p)->RestoreDisplayMode() - #define IDirectDraw3_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) - #define IDirectDraw3_SetDisplayMode(p,a,b,c,d,e) (p)->SetDisplayMode(a,b,c,d,e) - #define IDirectDraw3_WaitForVerticalBlank(p,a,b) (p)->WaitForVerticalBlank(a,b) - /*** IDirectDraw2 methods ***/ - #define IDirectDraw3_GetAvailableVidMem(p,a,b,c) (p)->GetAvailableVidMem(a,b,c) - /*** IDirectDraw3 methods ***/ - #define IDirectDraw3_GetSurfaceFromDC(p,a,b) (p)->GetSurfaceFromDC(a,b) - #endif -#undef INTERFACE -#endif - -#ifdef __cplusplus -} -#endif Removed: trunk/reactos/dll/directx/wine/ddraw/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/stu…
============================================================================== --- trunk/reactos/dll/directx/wine/ddraw/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/wine/ddraw/stubs.c (removed) @@ -1,8 +0,0 @@ -#include "ddraw_private.h" - -HRESULT WINAPI -D3DParseUnknownCommand( LPVOID lpCmd, - LPVOID *lpRetCmd) -{ - return DD_OK; -}
11 years, 3 months
1
0
0
0
[akhaldi] 60090: [DXGI][D3D8][D3D9][DDRAW][WINED3D] * Sync with Wine 1.7.1.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 13 23:50:10 2013 New Revision: 60090 URL:
http://svn.reactos.org/svn/reactos?rev=60090&view=rev
Log: [DXGI][D3D8][D3D9][DDRAW][WINED3D] * Sync with Wine 1.7.1. Modified: trunk/reactos/dll/directx/dxgi/device.c trunk/reactos/dll/directx/dxgi/dxgi_main.c trunk/reactos/dll/directx/wine/d3d8/CMakeLists.txt trunk/reactos/dll/directx/wine/d3d8/d3d8_private.h trunk/reactos/dll/directx/wine/d3d8/device.c trunk/reactos/dll/directx/wine/d3d8/directx.c trunk/reactos/dll/directx/wine/d3d8/surface.c trunk/reactos/dll/directx/wine/d3d8/texture.c trunk/reactos/dll/directx/wine/d3d8/volume.c trunk/reactos/dll/directx/wine/d3d9/CMakeLists.txt trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h trunk/reactos/dll/directx/wine/d3d9/device.c trunk/reactos/dll/directx/wine/d3d9/directx.c trunk/reactos/dll/directx/wine/d3d9/surface.c trunk/reactos/dll/directx/wine/d3d9/texture.c trunk/reactos/dll/directx/wine/d3d9/volume.c trunk/reactos/dll/directx/wine/ddraw/CMakeLists.txt trunk/reactos/dll/directx/wine/ddraw/ddraw.c trunk/reactos/dll/directx/wine/ddraw/ddraw_private.h trunk/reactos/dll/directx/wine/ddraw/device.c trunk/reactos/dll/directx/wine/ddraw/executebuffer.c trunk/reactos/dll/directx/wine/ddraw/main.c trunk/reactos/dll/directx/wine/ddraw/surface.c trunk/reactos/dll/directx/wine/ddraw/utils.c trunk/reactos/dll/directx/wine/ddraw/viewport.c trunk/reactos/dll/directx/wine/wined3d/CMakeLists.txt trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c trunk/reactos/dll/directx/wine/wined3d/buffer.c trunk/reactos/dll/directx/wine/wined3d/context.c trunk/reactos/dll/directx/wine/wined3d/device.c trunk/reactos/dll/directx/wine/wined3d/directx.c trunk/reactos/dll/directx/wine/wined3d/drawprim.c trunk/reactos/dll/directx/wine/wined3d/gl_compat.c trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c trunk/reactos/dll/directx/wine/wined3d/resource.c trunk/reactos/dll/directx/wine/wined3d/shader.c trunk/reactos/dll/directx/wine/wined3d/state.c trunk/reactos/dll/directx/wine/wined3d/stateblock.c trunk/reactos/dll/directx/wine/wined3d/surface.c trunk/reactos/dll/directx/wine/wined3d/swapchain.c trunk/reactos/dll/directx/wine/wined3d/texture.c trunk/reactos/dll/directx/wine/wined3d/utils.c trunk/reactos/dll/directx/wine/wined3d/vertexdeclaration.c trunk/reactos/dll/directx/wine/wined3d/volume.c trunk/reactos/dll/directx/wine/wined3d/wined3d.spec trunk/reactos/dll/directx/wine/wined3d/wined3d_gl.h trunk/reactos/dll/directx/wine/wined3d/wined3d_main.c trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h trunk/reactos/include/reactos/wine/wined3d.h trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/directx/dxgi/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/dxgi/device.c?…
Modified: trunk/reactos/dll/directx/dxgi/dxgi_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/dxgi/dxgi_main…
Modified: trunk/reactos/dll/directx/wine/d3d8/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/CMak…
Modified: trunk/reactos/dll/directx/wine/d3d8/d3d8_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/d3d8…
Modified: trunk/reactos/dll/directx/wine/d3d8/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/devi…
Modified: trunk/reactos/dll/directx/wine/d3d8/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/dire…
Modified: trunk/reactos/dll/directx/wine/d3d8/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/surf…
Modified: trunk/reactos/dll/directx/wine/d3d8/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/text…
Modified: trunk/reactos/dll/directx/wine/d3d8/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d8/volu…
Modified: trunk/reactos/dll/directx/wine/d3d9/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/CMak…
Modified: trunk/reactos/dll/directx/wine/d3d9/d3d9_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/d3d9…
Modified: trunk/reactos/dll/directx/wine/d3d9/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/devi…
Modified: trunk/reactos/dll/directx/wine/d3d9/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/dire…
Modified: trunk/reactos/dll/directx/wine/d3d9/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/surf…
Modified: trunk/reactos/dll/directx/wine/d3d9/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/text…
Modified: trunk/reactos/dll/directx/wine/d3d9/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/d3d9/volu…
Modified: trunk/reactos/dll/directx/wine/ddraw/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/CMa…
Modified: trunk/reactos/dll/directx/wine/ddraw/ddraw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/ddr…
Modified: trunk/reactos/dll/directx/wine/ddraw/ddraw_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/ddr…
Modified: trunk/reactos/dll/directx/wine/ddraw/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/dev…
Modified: trunk/reactos/dll/directx/wine/ddraw/executebuffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/exe…
Modified: trunk/reactos/dll/directx/wine/ddraw/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/mai…
Modified: trunk/reactos/dll/directx/wine/ddraw/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/sur…
Modified: trunk/reactos/dll/directx/wine/ddraw/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/uti…
Modified: trunk/reactos/dll/directx/wine/ddraw/viewport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/ddraw/vie…
Modified: trunk/reactos/dll/directx/wine/wined3d/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/C…
Modified: trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
Modified: trunk/reactos/dll/directx/wine/wined3d/ati_fragment_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
Modified: trunk/reactos/dll/directx/wine/wined3d/buffer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/b…
Modified: trunk/reactos/dll/directx/wine/wined3d/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/c…
Modified: trunk/reactos/dll/directx/wine/wined3d/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/directx.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/drawprim.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
Modified: trunk/reactos/dll/directx/wine/wined3d/gl_compat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/g…
Modified: trunk/reactos/dll/directx/wine/wined3d/glsl_shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/g…
Modified: trunk/reactos/dll/directx/wine/wined3d/resource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/r…
Modified: trunk/reactos/dll/directx/wine/wined3d/shader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/state.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/stateblock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/surface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/swapchain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/s…
Modified: trunk/reactos/dll/directx/wine/wined3d/texture.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/t…
Modified: trunk/reactos/dll/directx/wine/wined3d/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/u…
Modified: trunk/reactos/dll/directx/wine/wined3d/vertexdeclaration.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/v…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_gl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/dll/directx/wine/wined3d/wined3d_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/w…
Modified: trunk/reactos/include/reactos/wine/wined3d.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/wined…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
11 years, 3 months
1
0
0
0
[aandrejevic] 60089: [SOFT386] Start implementing paging support. Add support for exception error codes.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Fri Sep 13 23:01:18 2013 New Revision: 60089 URL:
http://svn.reactos.org/svn/reactos?rev=60089&view=rev
Log: [SOFT386] Start implementing paging support. Add support for exception error codes. Modified: branches/ntvdm/lib/soft386/common.c branches/ntvdm/lib/soft386/common.h Modified: branches/ntvdm/lib/soft386/common.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/common.c?rev=…
============================================================================== --- branches/ntvdm/lib/soft386/common.c [iso-8859-1] (original) +++ branches/ntvdm/lib/soft386/common.c [iso-8859-1] Fri Sep 13 23:01:18 2013 @@ -28,6 +28,18 @@ return GET_SEGMENT_RPL(State->SegmentRegs[SOFT386_REG_CS].Selector); } +static +inline +ULONG +Soft386GetPageTableEntry(PSOFT386_STATE State, + ULONG VirtualAddress) +{ + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + + return 0; +} + /* PUBLIC FUNCTIONS ***********************************************************/ inline @@ -41,6 +53,7 @@ { ULONG LinearAddress; PSOFT386_SEG_REG CachedDescriptor; + INT Cpl = Soft386GetCurrentPrivLevel(State); ASSERT(SegmentReg < SOFT386_NUM_SEG_REGS); @@ -97,18 +110,75 @@ /* Find the linear address */ LinearAddress = CachedDescriptor->Base + Offset; - // TODO: Paging support! - - /* Did the host provide a memory hook? */ - if (State->MemReadCallback) - { - /* Yes, call the host */ - State->MemReadCallback(State, LinearAddress, Buffer, Size); + /* Check if paging is enabled */ + if (State->ControlRegisters[SOFT386_REG_CR0] & SOFT386_CR0_PG) + { + ULONG Page; + SOFT386_PAGE_TABLE TableEntry; + + for (Page = PAGE_ALIGN(LinearAddress); + Page <= PAGE_ALIGN(LinearAddress + Size - 1); + Page += PAGE_SIZE) + { + ULONG PageOffset = 0, PageLength = PAGE_SIZE; + + /* Get the table entry */ + TableEntry.Value = Soft386GetPageTableEntry(State, Page); + + if (!TableEntry.Present || (!TableEntry.Usermode && (Cpl > 0))) + { + /* Exception */ + Soft386ExceptionWithErrorCode(State, + SOFT386_EXCEPTION_PF, + TableEntry.Value & 0x07); + return FALSE; + } + + /* Check if this is the first page */ + if (Page == PAGE_ALIGN(LinearAddress)) + { + /* Start copying from the offset from the beginning of the page */ + PageOffset = PAGE_OFFSET(LinearAddress); + } + + /* Check if this is the last page */ + if (Page == PAGE_ALIGN(LinearAddress + Size - 1)) + { + /* Copy only a part of the page */ + PageLength = PAGE_OFFSET(LinearAddress + Size); + } + + /* Did the host provide a memory hook? */ + if (State->MemReadCallback) + { + /* Yes, call the host */ + State->MemReadCallback(State, + (TableEntry.Address << 12) | PageOffset, + Buffer, + PageLength); + } + else + { + /* Read the memory directly */ + RtlMoveMemory(Buffer, + (PVOID)((TableEntry.Address << 12) | PageOffset), + PageLength); + } + } } else { - /* Read the memory directly */ - RtlMoveMemory(Buffer, (PVOID)LinearAddress, Size); + /* Did the host provide a memory hook? */ + if (State->MemReadCallback) + { + /* Yes, call the host */ + State->MemReadCallback(State, LinearAddress, Buffer, Size); + } + else + { + /* Read the memory directly */ + RtlMoveMemory(Buffer, (PVOID)LinearAddress, Size); + } } return TRUE; @@ -124,6 +194,7 @@ { ULONG LinearAddress; PSOFT386_SEG_REG CachedDescriptor; + INT Cpl = Soft386GetCurrentPrivLevel(State); ASSERT(SegmentReg < SOFT386_NUM_SEG_REGS); @@ -174,18 +245,77 @@ /* Find the linear address */ LinearAddress = CachedDescriptor->Base + Offset; - // TODO: Paging support! - - /* Did the host provide a memory hook? */ - if (State->MemWriteCallback) - { - /* Yes, call the host */ - State->MemWriteCallback(State, LinearAddress, Buffer, Size); + /* Check if paging is enabled */ + if (State->ControlRegisters[SOFT386_REG_CR0] & SOFT386_CR0_PG) + { + ULONG Page; + SOFT386_PAGE_TABLE TableEntry; + + for (Page = PAGE_ALIGN(LinearAddress); + Page <= PAGE_ALIGN(LinearAddress + Size - 1); + Page += PAGE_SIZE) + { + ULONG PageOffset = 0, PageLength = PAGE_SIZE; + + /* Get the table entry */ + TableEntry.Value = Soft386GetPageTableEntry(State, Page); + + if ((!TableEntry.Present || (!TableEntry.Usermode && (Cpl > 0))) + || ((State->ControlRegisters[SOFT386_REG_CR0] & SOFT386_CR0_WP) + && !TableEntry.Writeable)) + { + /* Exception */ + Soft386ExceptionWithErrorCode(State, + SOFT386_EXCEPTION_PF, + TableEntry.Value & 0x07); + return FALSE; + } + + /* Check if this is the first page */ + if (Page == PAGE_ALIGN(LinearAddress)) + { + /* Start copying from the offset from the beginning of the page */ + PageOffset = PAGE_OFFSET(LinearAddress); + } + + /* Check if this is the last page */ + if (Page == PAGE_ALIGN(LinearAddress + Size - 1)) + { + /* Copy only a part of the page */ + PageLength = PAGE_OFFSET(LinearAddress + Size); + } + + /* Did the host provide a memory hook? */ + if (State->MemWriteCallback) + { + /* Yes, call the host */ + State->MemWriteCallback(State, + (TableEntry.Address << 12) | PageOffset, + Buffer, + PageLength); + } + else + { + /* Read the memory directly */ + RtlMoveMemory((PVOID)((TableEntry.Address << 12) | PageOffset), + Buffer, + PageLength); + } + } } else { - /* Write the memory directly */ - RtlMoveMemory((PVOID)LinearAddress, Buffer, Size); + /* Did the host provide a memory hook? */ + if (State->MemWriteCallback) + { + /* Yes, call the host */ + State->MemWriteCallback(State, LinearAddress, Buffer, Size); + } + else + { + /* Write the memory directly */ + RtlMoveMemory((PVOID)LinearAddress, Buffer, Size); + } } return TRUE; @@ -709,7 +839,7 @@ VOID FASTCALL -Soft386Exception(PSOFT386_STATE State, INT ExceptionCode) +Soft386ExceptionWithErrorCode(PSOFT386_STATE State, INT ExceptionCode, ULONG ErrorCode) { SOFT386_IDT_ENTRY IdtEntry; @@ -752,6 +882,20 @@ */ return; } + + if (EXCEPTION_HAS_ERROR_CODE(ExceptionCode)) + { + /* Push the error code */ + Soft386StackPush(State, ErrorCode); + } +} + +inline +VOID +Soft386Exception(PSOFT386_STATE State, INT ExceptionCode) +{ + /* Call the internal function */ + Soft386ExceptionWithErrorCode(State, ExceptionCode, 0); } inline Modified: branches/ntvdm/lib/soft386/common.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/common.h?rev=…
============================================================================== --- branches/ntvdm/lib/soft386/common.h [iso-8859-1] (original) +++ branches/ntvdm/lib/soft386/common.h [iso-8859-1] Fri Sep 13 23:01:18 2013 @@ -20,6 +20,13 @@ #define SIGN_FLAG_LONG 0x80000000 #define GET_SEGMENT_RPL(s) ((s) & 3) #define GET_SEGMENT_INDEX(s) ((s) & 0xFFF8) +#define EXCEPTION_HAS_ERROR_CODE(x) (((x) == 8) || ((x) >= 10 && (x) <= 14)) +#define PAGE_ALIGN(x) ((x) & 0xFFFFF000) +#define PAGE_OFFSET(x) ((x) & 0x00000FFF) + +#ifndef PAGE_SIZE +#define PAGE_SIZE 4096 +#endif typedef struct _SOFT386_MOD_REG_RM { @@ -32,6 +39,47 @@ }; } SOFT386_MOD_REG_RM, *PSOFT386_MOD_REG_RM; +#pragma pack(push, 1) + +typedef struct _SOFT386_PAGE_DIR +{ + union + { + ULONG Present : 1; + ULONG Writeable : 1; + ULONG Usermode : 1; + ULONG WriteThrough : 1; + ULONG NoCache : 1; + ULONG Accessed : 1; + ULONG AlwaysZero : 1; + ULONG Size : 1; + ULONG Unused : 4; + ULONG TableAddress : 20; + }; + ULONG Value; +} SOFT386_PAGE_DIR, *PSOFT386_PAGE_DIR; + +typedef struct _SOFT386_PAGE_TABLE +{ + union + { + ULONG Present : 1; + ULONG Writeable : 1; + ULONG Usermode : 1; + ULONG WriteThrough : 1; + ULONG NoCache : 1; + ULONG Accessed : 1; + ULONG Dirty : 1; + ULONG AlwaysZero : 1; + ULONG Global : 1; + ULONG Unused : 3; + ULONG Address : 20; + }; + ULONG Value; +} SOFT386_PAGE_TABLE, *PSOFT386_PAGE_TABLE; + +#pragma pack(pop) + /* FUNCTIONS ******************************************************************/ inline @@ -126,7 +174,16 @@ ); VOID -__fastcall +FASTCALL +Soft386ExceptionWithErrorCode +( + PSOFT386_STATE State, + INT ExceptionCode, + ULONG ErrorCode +); + +inline +VOID Soft386Exception ( PSOFT386_STATE State,
11 years, 3 months
1
0
0
0
[akhaldi] 60088: [ATL100_WINETEST] * Import from Wine 1.7.1.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 13 22:51:58 2013 New Revision: 60088 URL:
http://svn.reactos.org/svn/reactos?rev=60088&view=rev
Log: [ATL100_WINETEST] * Import from Wine 1.7.1. Added: trunk/rostests/winetests/atl100/ trunk/rostests/winetests/atl100/CMakeLists.txt (with props) trunk/rostests/winetests/atl100/atl.c (with props) trunk/rostests/winetests/atl100/testlist.c (with props) Modified: trunk/rostests/winetests/CMakeLists.txt Modified: trunk/rostests/winetests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/CMakeLists.txt?…
============================================================================== --- trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] Fri Sep 13 22:51:58 2013 @@ -5,6 +5,7 @@ add_subdirectory(advpack) add_subdirectory(amstream) add_subdirectory(atl) +add_subdirectory(atl100) add_subdirectory(avifil32) add_subdirectory(browseui) add_subdirectory(cabinet) Added: trunk/rostests/winetests/atl100/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/atl100/CMakeLis…
============================================================================== --- trunk/rostests/winetests/atl100/CMakeLists.txt (added) +++ trunk/rostests/winetests/atl100/CMakeLists.txt [iso-8859-1] Fri Sep 13 22:51:58 2013 @@ -0,0 +1,8 @@ + +add_definitions(-D_ATL_VER=_ATL_VER_100) +list(APPEND SOURCE atl.c testlist.c) +add_executable(atl100_winetest ${SOURCE}) +target_link_libraries(atl100_winetest wine uuid) +set_module_type(atl100_winetest win32cui) +add_importlibs(atl100_winetest atl100 oleaut32 ole32 advapi32 user32 msvcrt kernel32 ntdll) +add_cd_file(TARGET atl100_winetest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/winetests/atl100/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/atl100/atl.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/atl100/atl.c?re…
============================================================================== --- trunk/rostests/winetests/atl100/atl.c (added) +++ trunk/rostests/winetests/atl100/atl.c [iso-8859-1] Fri Sep 13 22:51:58 2013 @@ -0,0 +1,621 @@ +/* + * Copyright 2012 Jacek Caban for CodeWeavers + * + * 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 <stdarg.h> +#include <stdio.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS +#define CONST_VTABLE + +#include <windef.h> +#include <winbase.h> +#include <winuser.h> +#include <winreg.h> +#include <wingdi.h> +#include <objbase.h> +#include <oleauto.h> + +#include <wine/atlbase.h> +#include <mshtml.h> + +#include <wine/test.h> + +static const GUID CLSID_Test = + {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; +#define CLSID_TEST_STR "178fc163-0000-0000-0000-000000000046" + +static const GUID CATID_CatTest1 = + {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x46}}; +#define CATID_CATTEST1_STR "178fc163-0000-0000-0000-000000000146" + +static const GUID CATID_CatTest2 = + {0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x46}}; +#define CATID_CATTEST2_STR "178fc163-0000-0000-0000-000000000246" + +static const char *debugstr_guid(REFIID riid) +{ + static char buf[50]; + + if(!riid) + return "(null)"; + + sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], + riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], + riid->Data4[5], riid->Data4[6], riid->Data4[7]); + + return buf; +} + +static void test_winmodule(void) +{ + _AtlCreateWndData create_data[3]; + _ATL_WIN_MODULE winmod; + void *p; + HRESULT hres; + + winmod.cbSize = 0xdeadbeef; + hres = AtlWinModuleInit(&winmod); + ok(hres == E_INVALIDARG, "AtlWinModuleInit failed: %08x\n", hres); + + winmod.cbSize = sizeof(winmod); + winmod.m_pCreateWndList = (void*)0xdeadbeef; + winmod.m_csWindowCreate.LockCount = 0xdeadbeef; + winmod.m_rgWindowClassAtoms.m_aT = (void*)0xdeadbeef; + winmod.m_rgWindowClassAtoms.m_nSize = 0xdeadbeef; + winmod.m_rgWindowClassAtoms.m_nAllocSize = 0xdeadbeef; + hres = AtlWinModuleInit(&winmod); + ok(hres == S_OK, "AtlWinModuleInit failed: %08x\n", hres); + ok(!winmod.m_pCreateWndList, "winmod.m_pCreateWndList = %p\n", winmod.m_pCreateWndList); + ok(winmod.m_csWindowCreate.LockCount == -1, "winmod.m_csWindowCreate.LockCount = %d\n", + winmod.m_csWindowCreate.LockCount); + ok(winmod.m_rgWindowClassAtoms.m_aT == (void*)0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_aT = %p\n", + winmod.m_rgWindowClassAtoms.m_aT); + ok(winmod.m_rgWindowClassAtoms.m_nSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nSize = %d\n", + winmod.m_rgWindowClassAtoms.m_nSize); + ok(winmod.m_rgWindowClassAtoms.m_nAllocSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nAllocSize = %d\n", + winmod.m_rgWindowClassAtoms.m_nAllocSize); + + InitializeCriticalSection(&winmod.m_csWindowCreate); + + AtlWinModuleAddCreateWndData(&winmod, create_data, (void*)0xdead0001); + ok(winmod.m_pCreateWndList == create_data, "winmod.m_pCreateWndList != create_data\n"); + ok(create_data[0].m_pThis == (void*)0xdead0001, "unexpected create_data[0].m_pThis %p\n", create_data[0].m_pThis); + ok(create_data[0].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[0].m_dwThreadID %x\n", + create_data[0].m_dwThreadID); + ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext); + + AtlWinModuleAddCreateWndData(&winmod, create_data+1, (void*)0xdead0002); + ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n"); + ok(create_data[1].m_pThis == (void*)0xdead0002, "unexpected create_data[1].m_pThis %p\n", create_data[1].m_pThis); + ok(create_data[1].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[1].m_dwThreadID %x\n", + create_data[1].m_dwThreadID); + ok(create_data[1].m_pNext == create_data, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext); + + AtlWinModuleAddCreateWndData(&winmod, create_data+2, (void*)0xdead0003); + ok(winmod.m_pCreateWndList == create_data+2, "winmod.m_pCreateWndList != create_data\n"); + ok(create_data[2].m_pThis == (void*)0xdead0003, "unexpected create_data[2].m_pThis %p\n", create_data[2].m_pThis); + ok(create_data[2].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[2].m_dwThreadID %x\n", + create_data[2].m_dwThreadID); + ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext); + + p = AtlWinModuleExtractCreateWndData(&winmod); + ok(p == (void*)0xdead0003, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p); + ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n"); + ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext); + + create_data[1].m_dwThreadID = 0xdeadbeef; + + p = AtlWinModuleExtractCreateWndData(&winmod); + ok(p == (void*)0xdead0001, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p); + ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n"); + ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext); + ok(!create_data[1].m_pNext, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext); + + p = AtlWinModuleExtractCreateWndData(&winmod); + ok(!p, "unexpected AtlWinModuleExtractCreateWndData result %p\n", p); + ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n"); +} + +#define test_key_exists(a,b) _test_key_exists(__LINE__,a,b) +static void _test_key_exists(unsigned line, HKEY root, const char *key_name) +{ + HKEY key; + DWORD res; + + res = RegOpenKeyA(root, key_name, &key); + ok_(__FILE__,line)(res == ERROR_SUCCESS, "Could not open key %s\n", key_name); + if(res == ERROR_SUCCESS) + RegCloseKey(key); +} + +#define test_key_not_exists(a,b) _test_key_not_exists(__LINE__,a,b) +static void _test_key_not_exists(unsigned line, HKEY root, const char *key_name) +{ + HKEY key; + DWORD res; + + res = RegOpenKeyA(root, key_name, &key); + ok_(__FILE__,line)(res == ERROR_FILE_NOT_FOUND, "Attempting to open %s returned %u\n", key_name, res); + if(res == ERROR_SUCCESS) + RegCloseKey(key); +} + +static void test_regcat(void) +{ + unsigned char b; + HRESULT hres; + + const struct _ATL_CATMAP_ENTRY catmap[] = { + {_ATL_CATMAP_ENTRY_IMPLEMENTED, &CATID_CatTest1}, + {_ATL_CATMAP_ENTRY_REQUIRED, &CATID_CatTest2}, + {_ATL_CATMAP_ENTRY_END} + }; + + hres = AtlRegisterClassCategoriesHelper(&CLSID_Test, catmap, TRUE); + ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres); + + test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}"); + test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Implemented Categories\\{" CATID_CATTEST1_STR "}"); + test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Required Categories\\{" CATID_CATTEST2_STR "}"); + + hres = AtlRegisterClassCategoriesHelper(&CLSID_Test, catmap, FALSE); + ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres); + + test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Implemented Categories"); + test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}\\Required Categories"); + test_key_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}"); + + ok(RegDeleteKeyA(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}") == ERROR_SUCCESS, "Could not delete key\n"); + + hres = AtlRegisterClassCategoriesHelper(&CLSID_Test, NULL, TRUE); + ok(hres == S_OK, "AtlRegisterClassCategoriesHelper failed: %08x\n", hres); + + test_key_not_exists(HKEY_CLASSES_ROOT, "CLSID\\{" CLSID_TEST_STR "}"); + + b = 10; + hres = AtlGetPerUserRegistration(&b); + ok(hres == S_OK, "AtlGetPerUserRegistration failed: %08x\n", hres); + ok(!b, "AtlGetPerUserRegistration returned %x\n", b); +} + +static void test_typelib(void) +{ + ITypeLib *typelib; + HINSTANCE inst; + size_t len; + BSTR path; + HRESULT hres; + + static const WCHAR scrrun_dll_suffixW[] = {'\\','s','c','r','r','u','n','.','d','l','l',0}; + static const WCHAR mshtml_tlb_suffixW[] = {'\\','m','s','h','t','m','l','.','t','l','b',0}; + + inst = LoadLibraryA("scrrun.dll"); + ok(inst != NULL, "Could not load scrrun.dll\n"); + + typelib = NULL; + hres = AtlLoadTypeLib(inst, NULL, &path, &typelib); + ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres); + FreeLibrary(inst); + + len = SysStringLen(path); + ok(len > sizeof(scrrun_dll_suffixW)/sizeof(WCHAR) + && lstrcmpiW(path+len-sizeof(scrrun_dll_suffixW)/sizeof(WCHAR), scrrun_dll_suffixW), + "unexpected path %s\n", wine_dbgstr_w(path)); + SysFreeString(path); + ok(typelib != NULL, "typelib == NULL\n"); + ITypeLib_Release(typelib); + + inst = LoadLibraryA("mshtml.dll"); + ok(inst != NULL, "Could not load mshtml.dll\n"); + + typelib = NULL; + hres = AtlLoadTypeLib(inst, NULL, &path, &typelib); + ok(hres == S_OK, "AtlLoadTypeLib failed: %08x\n", hres); + FreeLibrary(inst); + + len = SysStringLen(path); + ok(len > sizeof(mshtml_tlb_suffixW)/sizeof(WCHAR) + && lstrcmpiW(path+len-sizeof(mshtml_tlb_suffixW)/sizeof(WCHAR), mshtml_tlb_suffixW), + "unexpected path %s\n", wine_dbgstr_w(path)); + SysFreeString(path); + ok(typelib != NULL, "typelib == NULL\n"); + ITypeLib_Release(typelib); +} + +static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(&IID_IConnectionPoint, riid)) { + *ppv = iface; + return S_OK; + } + + ok(0, "unexpected call\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface) +{ + return 2; +} + +static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface) +{ + return 1; +} + +static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface, + IConnectionPointContainer **ppCPC) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static int advise_cnt; + +static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *pUnkSink, + DWORD *pdwCookie) +{ + ok(pUnkSink == (IUnknown*)0xdead0000, "pUnkSink = %p\n", pUnkSink); + *pdwCookie = 0xdeadbeef; + advise_cnt++; + return S_OK; +} + +static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dwCookie) +{ + ok(dwCookie == 0xdeadbeef, "dwCookie = %x\n", dwCookie); + advise_cnt--; + return S_OK; +} + +static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface, + IEnumConnections **ppEnum) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IConnectionPointVtbl ConnectionPointVtbl = +{ + ConnectionPoint_QueryInterface, + ConnectionPoint_AddRef, + ConnectionPoint_Release, + ConnectionPoint_GetConnectionInterface, + ConnectionPoint_GetConnectionPointContainer, + ConnectionPoint_Advise, + ConnectionPoint_Unadvise, + ConnectionPoint_EnumConnections +}; + +static IConnectionPoint ConnectionPoint = { &ConnectionPointVtbl }; + +static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, + REFIID riid, void **ppv) +{ + if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { + *ppv = iface; + return S_OK; + } + + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface) +{ + return 2; +} + +static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface) +{ + return 1; +} + +static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface, + IEnumConnectionPoints **ppEnum) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, + REFIID riid, IConnectionPoint **ppCP) +{ + ok(IsEqualGUID(riid, &CLSID_Test), "unexpected riid\n"); + *ppCP = &ConnectionPoint; + return S_OK; +} + +static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl = { + ConnectionPointContainer_QueryInterface, + ConnectionPointContainer_AddRef, + ConnectionPointContainer_Release, + ConnectionPointContainer_EnumConnectionPoints, + ConnectionPointContainer_FindConnectionPoint +}; + +static IConnectionPointContainer ConnectionPointContainer = { &ConnectionPointContainerVtbl }; + +static void test_cp(void) +{ + DWORD cookie = 0; + HRESULT hres; + + hres = AtlAdvise(NULL, (IUnknown*)0xdeed0000, &CLSID_Test, &cookie); + ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08x\n", hres); + + hres = AtlUnadvise(NULL, &CLSID_Test, 0xdeadbeef); + ok(hres == E_INVALIDARG, "expect E_INVALIDARG, returned %08x\n", hres); + + hres = AtlAdvise((IUnknown*)&ConnectionPointContainer, (IUnknown*)0xdead0000, &CLSID_Test, &cookie); + ok(hres == S_OK, "AtlAdvise failed: %08x\n", hres); + ok(cookie == 0xdeadbeef, "cookie = %x\n", cookie); + ok(advise_cnt == 1, "advise_cnt = %d\n", advise_cnt); + + hres = AtlUnadvise((IUnknown*)&ConnectionPointContainer, &CLSID_Test, 0xdeadbeef); + ok(hres == S_OK, "AtlUnadvise failed: %08x\n", hres); + ok(!advise_cnt, "advise_cnt = %d\n", advise_cnt); +} + +static CLSID persist_clsid; + +static HRESULT WINAPI Persist_QueryInterface(IPersist *iface, REFIID riid, void **ppv) +{ + ok(0, "unexpected call\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI Persist_AddRef(IPersist *iface) +{ + return 2; +} + +static ULONG WINAPI Persist_Release(IPersist *iface) +{ + return 1; +} + +static HRESULT WINAPI Persist_GetClassID(IPersist *iface, CLSID *pClassID) +{ + *pClassID = persist_clsid; + return S_OK; +} + +static const IPersistVtbl PersistVtbl = { + Persist_QueryInterface, + Persist_AddRef, + Persist_Release, + Persist_GetClassID +}; + +static IPersist Persist = { &PersistVtbl }; + +static HRESULT WINAPI ProvideClassInfo2_QueryInterface(IProvideClassInfo2 *iface, REFIID riid, void **ppv) +{ + ok(0, "unexpected call\n"); + return E_NOINTERFACE; +} + +static ULONG WINAPI ProvideClassInfo2_AddRef(IProvideClassInfo2 *iface) +{ + return 2; +} + +static ULONG WINAPI ProvideClassInfo2_Release(IProvideClassInfo2 *iface) +{ + return 1; +} + +static HRESULT WINAPI ProvideClassInfo2_GetClassInfo(IProvideClassInfo2 *iface, ITypeInfo **ppTI) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI ProvideClassInfo2_GetGUID(IProvideClassInfo2 *iface, DWORD dwGuidKind, GUID *pGUID) +{ + ok(dwGuidKind == GUIDKIND_DEFAULT_SOURCE_DISP_IID, "unexpected dwGuidKind %x\n", dwGuidKind); + *pGUID = DIID_DispHTMLBody; + return S_OK; +} + +static const IProvideClassInfo2Vtbl ProvideClassInfo2Vtbl = { + ProvideClassInfo2_QueryInterface, + ProvideClassInfo2_AddRef, + ProvideClassInfo2_Release, + ProvideClassInfo2_GetClassInfo, + ProvideClassInfo2_GetGUID +}; + +static IProvideClassInfo2 ProvideClassInfo2 = { &ProvideClassInfo2Vtbl }; +static BOOL support_classinfo2; + +static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv) +{ + *ppv = NULL; + + if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IDispatch, riid)) { + *ppv = iface; + return S_OK; + } + + if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) { + if(!support_classinfo2) + return E_NOINTERFACE; + *ppv = &ProvideClassInfo2; + return S_OK; + } + + if(IsEqualGUID(&IID_IPersist, riid)) { + *ppv = &Persist; + return S_OK; + } + + ok(0, "unexpected riid: %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI Dispatch_AddRef(IDispatch *iface) +{ + return 2; +} + +static ULONG WINAPI Dispatch_Release(IDispatch *iface) +{ + return 1; +} + +static HRESULT WINAPI Dispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Dispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, + ITypeInfo **ppTInfo) +{ + ITypeLib *typelib; + HRESULT hres; + + static const WCHAR mshtml_tlbW[] = {'m','s','h','t','m','l','.','t','l','b',0}; + + ok(!iTInfo, "iTInfo = %d\n", iTInfo); + ok(!lcid, "lcid = %x\n", lcid); + + hres = LoadTypeLib(mshtml_tlbW, &typelib); + ok(hres == S_OK, "LoadTypeLib failed: %08x\n", hres); + + hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IHTMLElement, ppTInfo); + ok(hres == S_OK, "GetTypeInfoOfGuid failed: %08x\n", hres); + + ITypeLib_Release(typelib); + return S_OK; +} + +static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid, + LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, + EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IDispatchVtbl DispatchVtbl = { + Dispatch_QueryInterface, + Dispatch_AddRef, + Dispatch_Release, + Dispatch_GetTypeInfoCount, + Dispatch_GetTypeInfo, + Dispatch_GetIDsOfNames, + Dispatch_Invoke +}; + +static IDispatch Dispatch = { &DispatchVtbl }; + +static void test_source_iface(void) +{ + unsigned short maj_ver, min_ver; + IID libid, iid; + HRESULT hres; + + support_classinfo2 = TRUE; + + maj_ver = min_ver = 0xdead; + hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver); + ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08x\n", hres); + ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", debugstr_guid(&libid)); + ok(IsEqualGUID(&iid, &DIID_DispHTMLBody), "iid = %s\n", debugstr_guid(&iid)); + ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver); + + support_classinfo2 = FALSE; + persist_clsid = CLSID_HTMLDocument; + + maj_ver = min_ver = 0xdead; + hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver); + ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08x\n", hres); + ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", debugstr_guid(&libid)); + ok(IsEqualGUID(&iid, &DIID_HTMLDocumentEvents), "iid = %s\n", debugstr_guid(&iid)); + ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver); + + persist_clsid = CLSID_HTMLStyle; + + maj_ver = min_ver = 0xdead; + hres = AtlGetObjectSourceInterface((IUnknown*)&Dispatch, &libid, &iid, &maj_ver, &min_ver); + ok(hres == S_OK, "AtlGetObjectSourceInterface failed: %08x\n", hres); + ok(IsEqualGUID(&libid, &LIBID_MSHTML), "libid = %s\n", debugstr_guid(&libid)); + ok(IsEqualGUID(&iid, &IID_NULL), "iid = %s\n", debugstr_guid(&iid)); + ok(maj_ver == 4 && min_ver == 0, "ver = %d.%d\n", maj_ver, min_ver); +} + +static void test_ax_win(void) +{ + BOOL ret; + WNDCLASSEXW wcex; + static const WCHAR AtlAxWin100[] = {'A','t','l','A','x','W','i','n','1','0','0',0}; + static const WCHAR AtlAxWinLic100[] = {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0}; + static HMODULE hinstance = 0; + + ret = AtlAxWinInit(); + ok(ret, "AtlAxWinInit failed\n"); + + hinstance = GetModuleHandleA(NULL); + + memset(&wcex, 0, sizeof(wcex)); + wcex.cbSize = sizeof(wcex); + ret = GetClassInfoExW(hinstance, AtlAxWin100, &wcex); + ok(ret, "AtlAxWin100 has not registered\n"); + ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style); + + memset(&wcex, 0, sizeof(wcex)); + wcex.cbSize = sizeof(wcex); + ret = GetClassInfoExW(hinstance, AtlAxWinLic100, &wcex); + ok(ret, "AtlAxWinLic100 has not registered\n"); + ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style); +} + +START_TEST(atl) +{ + CoInitialize(NULL); + + test_winmodule(); + test_regcat(); + test_typelib(); + test_cp(); + test_source_iface(); + test_ax_win(); + + CoUninitialize(); +} Propchange: trunk/rostests/winetests/atl100/atl.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/atl100/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/atl100/testlist…
============================================================================== --- trunk/rostests/winetests/atl100/testlist.c (added) +++ trunk/rostests/winetests/atl100/testlist.c [iso-8859-1] Fri Sep 13 22:51:58 2013 @@ -0,0 +1,12 @@ +/* Automatically generated file; DO NOT EDIT!! */ + +#define STANDALONE +#include <wine/test.h> + +extern void func_atl(void); + +const struct test winetest_testlist[] = +{ + { "atl", func_atl }, + { 0, 0 } +}; Propchange: trunk/rostests/winetests/atl100/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
11 years, 3 months
1
0
0
0
[akhaldi] 60087: [ATL100] * Sync with Wine 1.7.1.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 13 22:50:10 2013 New Revision: 60087 URL:
http://svn.reactos.org/svn/reactos?rev=60087&view=rev
Log: [ATL100] * Sync with Wine 1.7.1. Modified: trunk/reactos/dll/win32/atl100/CMakeLists.txt trunk/reactos/dll/win32/atl100/atl.c trunk/reactos/dll/win32/atl100/atl100.spec trunk/reactos/dll/win32/atl100/atl_ax.c trunk/reactos/dll/win32/atl100/registrar.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/atl100/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl100/CMakeList…
============================================================================== --- trunk/reactos/dll/win32/atl100/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/atl100/CMakeLists.txt [iso-8859-1] Fri Sep 13 22:50:10 2013 @@ -1,5 +1,7 @@ -add_definitions(-D__WINESRC__) +add_definitions( + -D__WINESRC__ + -D_ATL_VER=_ATL_VER_100) remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) @@ -18,6 +20,5 @@ add_library(atl100 SHARED ${SOURCE}) set_module_type(atl100 win32dll) target_link_libraries(atl100 uuid wine) - add_importlibs(atl100 ole32 oleaut32 user32 gdi32 advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET atl100 DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/dll/win32/atl100/atl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl100/atl.c?rev…
============================================================================== --- trunk/reactos/dll/win32/atl100/atl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/atl100/atl.c [iso-8859-1] Fri Sep 13 22:50:10 2013 @@ -1,5 +1,6 @@ /* * Copyright 2012 Stefan Leichter + * Copyright 2012 Jacek Caban for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,22 +26,58 @@ #include <stdarg.h> #include <windef.h> #include <winbase.h> +#include <winreg.h> #include <wingdi.h> #include <objbase.h> - -#include <atlbase.h> +#include <oleauto.h> + +#include <wine/atlbase.h> +#include <wine/unicode.h> #include <wine/debug.h> -WINE_DEFAULT_DEBUG_CHANNEL(atl); +WINE_DEFAULT_DEBUG_CHANNEL(atl100); + +typedef unsigned char cpp_bool; + +static inline void *heap_alloc(size_t len) +{ + return HeapAlloc(GetProcessHeap(), 0, len); +} + +static inline BOOL heap_free(void *mem) +{ + return HeapFree(GetProcessHeap(), 0, mem); +} + +static ICatRegister *catreg; /*********************************************************************** * AtlAdvise [atl100.@] */ -HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, LPDWORD pdw) -{ - FIXME("%p %p %p %p\n", pUnkCP, pUnk, iid, pdw); - return E_FAIL; +HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw) +{ + IConnectionPointContainer *container; + IConnectionPoint *cp; + HRESULT hres; + + TRACE("%p %p %p %p\n", pUnkCP, pUnk, iid, pdw); + + if(!pUnkCP) + return E_INVALIDARG; + + hres = IUnknown_QueryInterface(pUnkCP, &IID_IConnectionPointContainer, (void**)&container); + if(FAILED(hres)) + return hres; + + hres = IConnectionPointContainer_FindConnectionPoint(container, iid, &cp); + IConnectionPointContainer_Release(container); + if(FAILED(hres)) + return hres; + + hres = IConnectionPoint_Advise(cp, pUnk, pdw); + IConnectionPoint_Release(cp); + return hres; } /*********************************************************************** @@ -48,8 +85,27 @@ */ HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw) { - FIXME("%p %p %d\n", pUnkCP, iid, dw); - return S_OK; + IConnectionPointContainer *container; + IConnectionPoint *cp; + HRESULT hres; + + TRACE("%p %p %d\n", pUnkCP, iid, dw); + + if(!pUnkCP) + return E_INVALIDARG; + + hres = IUnknown_QueryInterface(pUnkCP, &IID_IConnectionPointContainer, (void**)&container); + if(FAILED(hres)) + return hres; + + hres = IConnectionPointContainer_FindConnectionPoint(container, iid, &cp); + IConnectionPointContainer_Release(container); + if(FAILED(hres)) + return hres; + + hres = IConnectionPoint_Unadvise(cp, dw); + IConnectionPoint_Release(cp); + return hres; } /*********************************************************************** @@ -237,9 +293,525 @@ } /*********************************************************************** + * AtlIPersistPropertyBag_Load [atl100.@] + */ +HRESULT WINAPI AtlIPersistPropertyBag_Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog, + ATL_PROPMAP_ENTRY *pMap, void *pThis, + IUnknown *pUnk) +{ + FIXME("(%p, %p, %p, %p, %p)\n", pPropBag, pErrorLog, pMap, pThis, pUnk); + + return S_OK; +} + +/*********************************************************************** + * AtlModuleAddTermFunc [atl100.@] + */ +HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULE *pM, _ATL_TERMFUNC *pFunc, DWORD_PTR dw) +{ + _ATL_TERMFUNC_ELEM *termfunc_elem; + + TRACE("(%p %p %ld)\n", pM, pFunc, dw); + + termfunc_elem = HeapAlloc(GetProcessHeap(), 0, sizeof(_ATL_TERMFUNC_ELEM)); + termfunc_elem->pFunc = pFunc; + termfunc_elem->dw = dw; + termfunc_elem->pNext = pM->m_pTermFuncs; + + pM->m_pTermFuncs = termfunc_elem; + + return S_OK; +} + +/*********************************************************************** + * AtlCallTermFunc [atl100.@] + */ +void WINAPI AtlCallTermFunc(_ATL_MODULE *pM) +{ + _ATL_TERMFUNC_ELEM *iter = pM->m_pTermFuncs, *tmp; + + TRACE("(%p)\n", pM); + + while(iter) { + iter->pFunc(iter->dw); + tmp = iter; + iter = iter->pNext; + HeapFree(GetProcessHeap(), 0, tmp); + } + + pM->m_pTermFuncs = NULL; +} + +/*********************************************************************** + * AtlLoadTypeLib [atl100.56] + */ +HRESULT WINAPI AtlLoadTypeLib(HINSTANCE inst, LPCOLESTR lpszIndex, + BSTR *pbstrPath, ITypeLib **ppTypeLib) +{ + size_t path_len, index_len; + ITypeLib *typelib = NULL; + WCHAR *path; + HRESULT hres; + + static const WCHAR tlb_extW[] = {'.','t','l','b',0}; + + TRACE("(%p %s %p %p)\n", inst, debugstr_w(lpszIndex), pbstrPath, ppTypeLib); + + index_len = lpszIndex ? strlenW(lpszIndex) : 0; + path = heap_alloc((MAX_PATH+index_len)*sizeof(WCHAR) + sizeof(tlb_extW)); + if(!path) + return E_OUTOFMEMORY; + + path_len = GetModuleFileNameW(inst, path, MAX_PATH); + if(!path_len) { + heap_free(path); + return HRESULT_FROM_WIN32(GetLastError()); + } + + if(index_len) + memcpy(path+path_len, lpszIndex, (index_len+1)*sizeof(WCHAR)); + + hres = LoadTypeLib(path, &typelib); + if(FAILED(hres)) { + WCHAR *ptr; + + for(ptr = path+path_len-1; ptr > path && *ptr != '\\' && *ptr != '.'; ptr--); + if(*ptr != '.') + ptr = path+path_len; + memcpy(ptr, tlb_extW, sizeof(tlb_extW)); + hres = LoadTypeLib(path, &typelib); + } + + if(SUCCEEDED(hres)) { + *pbstrPath = SysAllocString(path); + if(!*pbstrPath) { + ITypeLib_Release(typelib); + hres = E_OUTOFMEMORY; + } + } + + heap_free(path); + if(FAILED(hres)) + return hres; + + *ppTypeLib = typelib; + return S_OK; +} + +/*********************************************************************** + * AtlWinModuleInit [atl100.65] + */ +HRESULT WINAPI AtlWinModuleInit(_ATL_WIN_MODULE *winmod) +{ + TRACE("(%p\n", winmod); + + if(winmod->cbSize != sizeof(*winmod)) + return E_INVALIDARG; + + InitializeCriticalSection(&winmod->m_csWindowCreate); + winmod->m_pCreateWndList = NULL; + return S_OK; +} + +/*********************************************************************** + * AtlWinModuleAddCreateWndData [atl100.43] + */ +void WINAPI AtlWinModuleAddCreateWndData(_ATL_WIN_MODULE *pM, _AtlCreateWndData *pData, void *pvObject) +{ + TRACE("(%p, %p, %p)\n", pM, pData, pvObject); + + pData->m_pThis = pvObject; + pData->m_dwThreadID = GetCurrentThreadId(); + + EnterCriticalSection(&pM->m_csWindowCreate); + pData->m_pNext = pM->m_pCreateWndList; + pM->m_pCreateWndList = pData; + LeaveCriticalSection(&pM->m_csWindowCreate); +} + +/*********************************************************************** + * AtlWinModuleExtractCreateWndData [atl100.44] + */ +void* WINAPI AtlWinModuleExtractCreateWndData(_ATL_WIN_MODULE *winmod) +{ + _AtlCreateWndData *iter, *prev = NULL; + DWORD thread_id; + + TRACE("(%p)\n", winmod); + + thread_id = GetCurrentThreadId(); + + EnterCriticalSection(&winmod->m_csWindowCreate); + + for(iter = winmod->m_pCreateWndList; iter && iter->m_dwThreadID != thread_id; iter = iter->m_pNext) + prev = iter; + if(iter) { + if(prev) + prev->m_pNext = iter->m_pNext; + else + winmod->m_pCreateWndList = iter->m_pNext; + } + + LeaveCriticalSection(&winmod->m_csWindowCreate); + + return iter ? iter->m_pThis : NULL; +} + +/*********************************************************************** + * AtlComModuleGetClassObject [atl100.15] + */ +HRESULT WINAPI AtlComModuleGetClassObject(_ATL_COM_MODULE *pm, REFCLSID rclsid, REFIID riid, void **ppv) +{ + _ATL_OBJMAP_ENTRY **iter; + HRESULT hres; + + TRACE("(%p %s %s %p)\n", pm, debugstr_guid(rclsid), debugstr_guid(riid), ppv); + + if(!pm) + return E_INVALIDARG; + + for(iter = pm->m_ppAutoObjMapFirst; iter < pm->m_ppAutoObjMapLast; iter++) { + if(IsEqualCLSID((*iter)->pclsid, rclsid) && (*iter)->pfnGetClassObject) { + if(!(*iter)->pCF) + hres = (*iter)->pfnGetClassObject((*iter)->pfnCreateInstance, &IID_IUnknown, (void**)&(*iter)->pCF); + if((*iter)->pCF) + hres = IUnknown_QueryInterface((*iter)->pCF, riid, ppv); + TRACE("returning %p (%08x)\n", *ppv, hres); + return hres; + } + } + + WARN("Class %s not found\n", debugstr_guid(rclsid)); + return CLASS_E_CLASSNOTAVAILABLE; +} + +/*********************************************************************** + * AtlComModuleRegisterClassObjects [atl100.17] + */ +HRESULT WINAPI AtlComModuleRegisterClassObjects(_ATL_COM_MODULE *module, DWORD context, DWORD flags) +{ + _ATL_OBJMAP_ENTRY **iter; + IUnknown *unk; + HRESULT hres; + + TRACE("(%p %x %x)\n", module, context, flags); + + if(!module) + return E_INVALIDARG; + + for(iter = module->m_ppAutoObjMapFirst; iter < module->m_ppAutoObjMapLast; iter++) { + if(!(*iter)->pfnGetClassObject) + continue; + + hres = (*iter)->pfnGetClassObject((*iter)->pfnCreateInstance, &IID_IUnknown, (void**)&unk); + if(FAILED(hres)) + return hres; + + hres = CoRegisterClassObject((*iter)->pclsid, unk, context, flags, &(*iter)->dwRegister); + IUnknown_Release(unk); + if(FAILED(hres)) + return hres; + } + + return S_OK; + +} + +/*********************************************************************** + * AtlComModuleUnregisterServer [atl100.22] + */ +HRESULT WINAPI AtlComModuleUnregisterServer(_ATL_COM_MODULE *mod, BOOL bRegTypeLib, const CLSID *clsid) +{ + const struct _ATL_CATMAP_ENTRY *catmap; + _ATL_OBJMAP_ENTRY **iter; + HRESULT hres; + + TRACE("(%p %x %s)\n", mod, bRegTypeLib, debugstr_guid(clsid)); + + for(iter = mod->m_ppAutoObjMapFirst; iter < mod->m_ppAutoObjMapLast; iter++) { + if(!*iter || (clsid && !IsEqualCLSID((*iter)->pclsid, clsid))) + continue; + + TRACE("Unregistering clsid %s\n", debugstr_guid((*iter)->pclsid)); + + catmap = (*iter)->pfnGetCategoryMap(); + if(catmap) { + hres = AtlRegisterClassCategoriesHelper((*iter)->pclsid, catmap, FALSE); + if(FAILED(hres)) + return hres; + } + + hres = (*iter)->pfnUpdateRegistry(FALSE); + if(FAILED(hres)) + return hres; + } + + if(bRegTypeLib) { + ITypeLib *typelib; + TLIBATTR *attr; + BSTR path; + + hres = AtlLoadTypeLib(mod->m_hInstTypeLib, NULL, &path, &typelib); + if(FAILED(hres)) + return hres; + + SysFreeString(path); + hres = ITypeLib_GetLibAttr(typelib, &attr); + if(SUCCEEDED(hres)) { + hres = UnRegisterTypeLib(&attr->guid, attr->wMajorVerNum, attr->wMinorVerNum, attr->lcid, attr->syskind); + ITypeLib_ReleaseTLibAttr(typelib, attr); + } + ITypeLib_Release(typelib); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} + +/*********************************************************************** + * AtlRegisterClassCategoriesHelper [atl100.49] + */ +HRESULT WINAPI AtlRegisterClassCategoriesHelper(REFCLSID clsid, const struct _ATL_CATMAP_ENTRY *catmap, BOOL reg) +{ + const struct _ATL_CATMAP_ENTRY *iter; + HRESULT hres; + + TRACE("(%s %p %x)\n", debugstr_guid(clsid), catmap, reg); + + if(!catmap) + return S_OK; + + if(!catreg) { + ICatRegister *new_catreg; + + hres = CoCreateInstance(&CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, + &IID_ICatRegister, (void**)&new_catreg); + if(FAILED(hres)) + return hres; + + if(InterlockedCompareExchangePointer((void**)&catreg, new_catreg, NULL)) + ICatRegister_Release(new_catreg); + } + + for(iter = catmap; iter->iType != _ATL_CATMAP_ENTRY_END; iter++) { + CATID catid = *iter->pcatid; /* For stupid lack of const in ICatRegister declaration. */ + + if(iter->iType == _ATL_CATMAP_ENTRY_IMPLEMENTED) { + if(reg) + hres = ICatRegister_RegisterClassImplCategories(catreg, clsid, 1, &catid); + else + hres = ICatRegister_UnRegisterClassImplCategories(catreg, clsid, 1, &catid); + }else { + if(reg) + hres = ICatRegister_RegisterClassReqCategories(catreg, clsid, 1, &catid); + else + hres = ICatRegister_UnRegisterClassReqCategories(catreg, clsid, 1, &catid); + } + if(FAILED(hres)) + return hres; + } + + if(!reg) { + WCHAR reg_path[256] = {'C','L','S','I','D','\\'}, *ptr = reg_path+6; + + static const WCHAR implemented_catW[] = + {'I','m','p','l','e','m','e','n','t','e','d',' ','C','a','t','e','g','o','r','i','e','s',0}; + static const WCHAR required_catW[] = + {'R','e','q','u','i','r','e','d',' ','C','a','t','e','g','o','r','i','e','s',0}; + + ptr += StringFromGUID2(clsid, ptr, 64)-1; + *ptr++ = '\\'; + + memcpy(ptr, implemented_catW, sizeof(implemented_catW)); + RegDeleteKeyW(HKEY_CLASSES_ROOT, reg_path); + + memcpy(ptr, required_catW, sizeof(required_catW)); + RegDeleteKeyW(HKEY_CLASSES_ROOT, reg_path); + } + + return S_OK; +} + +/*********************************************************************** + * AtlWaitWithMessageLoop [atl100.24] + */ +BOOL WINAPI AtlWaitWithMessageLoop(HANDLE handle) +{ + MSG msg; + DWORD res; + + TRACE("(%p)\n", handle); + + while(1) { + res = MsgWaitForMultipleObjects(1, &handle, FALSE, INFINITE, QS_ALLINPUT); + switch(res) { + case WAIT_OBJECT_0: + return TRUE; + case WAIT_OBJECT_0+1: + if(GetMessageW(&msg, NULL, 0, 0) < 0) + return FALSE; + + TranslateMessage(&msg); + DispatchMessageW(&msg); + break; + default: + return FALSE; + } + } +} + +static HRESULT get_default_source(ITypeLib *typelib, const CLSID *clsid, IID *iid) +{ + ITypeInfo *typeinfo, *src_typeinfo = NULL; + TYPEATTR *attr; + int type_flags; + unsigned i; + HRESULT hres; + + hres = ITypeLib_GetTypeInfoOfGuid(typelib, clsid, &typeinfo); + if(FAILED(hres)) + return hres; + + hres = ITypeInfo_GetTypeAttr(typeinfo, &attr); + if(FAILED(hres)) { + ITypeInfo_Release(typeinfo); + return hres; + } + + for(i=0; i < attr->cImplTypes; i++) { + hres = ITypeInfo_GetImplTypeFlags(typeinfo, i, &type_flags); + if(SUCCEEDED(hres) && type_flags == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) { + HREFTYPE ref; + + hres = ITypeInfo_GetRefTypeOfImplType(typeinfo, i, &ref); + if(SUCCEEDED(hres)) + hres = ITypeInfo_GetRefTypeInfo(typeinfo, ref, &src_typeinfo); + break; + } + } + + ITypeInfo_ReleaseTypeAttr(typeinfo, attr); + ITypeInfo_Release(typeinfo); + if(FAILED(hres)) + return hres; + + if(!src_typeinfo) { + *iid = IID_NULL; + return S_OK; + } + + hres = ITypeInfo_GetTypeAttr(src_typeinfo, &attr); + if(SUCCEEDED(hres)) { + *iid = attr->guid; + ITypeInfo_ReleaseTypeAttr(src_typeinfo, attr); + } + ITypeInfo_Release(src_typeinfo); + return hres; +} + +/*********************************************************************** + * AtlGetObjectSourceInterface [atl100.54] + */ +HRESULT WINAPI AtlGetObjectSourceInterface(IUnknown *unk, GUID *libid, IID *iid, unsigned short *major, unsigned short *minor) +{ + IProvideClassInfo2 *classinfo; + ITypeInfo *typeinfo; + ITypeLib *typelib; + IPersist *persist; + IDispatch *disp; + HRESULT hres; + + TRACE("(%p %p %p %p %p)\n", unk, libid, iid, major, minor); + + hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&disp); + if(FAILED(hres)) + return hres; + + hres = IDispatch_GetTypeInfo(disp, 0, 0, &typeinfo); + IDispatch_Release(disp); + if(FAILED(hres)) + return hres; + + hres = ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, 0); + ITypeInfo_Release(typeinfo); + if(SUCCEEDED(hres)) { + TLIBATTR *attr; + + hres = ITypeLib_GetLibAttr(typelib, &attr); + if(SUCCEEDED(hres)) { + *libid = attr->guid; + *major = attr->wMajorVerNum; + *minor = attr->wMinorVerNum; + ITypeLib_ReleaseTLibAttr(typelib, attr); + }else { + ITypeLib_Release(typelib); + } + } + if(FAILED(hres)) + return hres; + + hres = IUnknown_QueryInterface(unk, &IID_IProvideClassInfo2, (void**)&classinfo); + if(SUCCEEDED(hres)) { + hres = IProvideClassInfo2_GetGUID(classinfo, GUIDKIND_DEFAULT_SOURCE_DISP_IID, iid); + IProvideClassInfo2_Release(classinfo); + ITypeLib_Release(typelib); + return hres; + } + + hres = IUnknown_QueryInterface(unk, &IID_IPersist, (void**)&persist); + if(SUCCEEDED(hres)) { + CLSID clsid; + + hres = IPersist_GetClassID(persist, &clsid); + if(SUCCEEDED(hres)) + hres = get_default_source(typelib, &clsid, iid); + IPersist_Release(persist); + } + + return hres; +} + +/*********************************************************************** + * AtlSetPerUserRegistration [atl100.67] + */ +HRESULT WINAPI AtlSetPerUserRegistration(cpp_bool bEnable) +{ + FIXME("stub: bEnable: %d\n", bEnable); + return E_NOTIMPL; +} + +/*********************************************************************** + * AtlGetPerUserRegistration [atl100.68] + */ +HRESULT WINAPI AtlGetPerUserRegistration(cpp_bool *pbEnabled) +{ + FIXME("stub: returning false\n"); + *pbEnabled = 0; + return S_OK; +} + +/*********************************************************************** * AtlGetVersion [atl100.@] */ DWORD WINAPI AtlGetVersion(void *pReserved) { - return 0x0a00; -} + return _ATL_VER; +} + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); + + switch(fdwReason) { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + case DLL_PROCESS_DETACH: + if (lpvReserved) break; + if(catreg) + ICatRegister_Release(catreg); + } + + return TRUE; +} Modified: trunk/reactos/dll/win32/atl100/atl100.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl100/atl100.sp…
============================================================================== --- trunk/reactos/dll/win32/atl100/atl100.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/atl100/atl100.spec [iso-8859-1] Fri Sep 13 22:50:10 2013 @@ -3,12 +3,12 @@ 12 stdcall AtlFreeMarshalStream(ptr) 13 stdcall AtlMarshalPtrInProc(ptr ptr ptr) 14 stdcall AtlUnmarshalPtr(ptr ptr ptr) -15 stub AtlComModuleGetClassObject -17 stub AtlComModuleRegisterClassObjects +15 stdcall AtlComModuleGetClassObject(ptr ptr ptr ptr) +17 stdcall AtlComModuleRegisterClassObjects(ptr long long) 20 stub AtlComModuleRevokeClassObjects -22 stub AtlComModuleUnregisterServer -23 stub AtlUpdateRegistryFromResourceD -24 stub AtlWaitWithMessageLoop +22 stdcall AtlComModuleUnregisterServer(ptr long ptr) +23 stdcall AtlUpdateRegistryFromResourceD(long wstr long ptr ptr) +24 stdcall AtlWaitWithMessageLoop(long) 25 stub AtlSetErrorInfo 26 stdcall AtlCreateTargetDC(long ptr) 27 stdcall AtlHiMetricToPixel(ptr ptr) @@ -18,35 +18,35 @@ 31 stdcall AtlComQIPtrAssign(ptr ptr ptr) 32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr) 34 stdcall AtlGetVersion(ptr) -35 stub AtlAxDialogBoxW -36 stub AtlAxDialogBoxA +35 stdcall AtlAxDialogBoxW(long wstr long ptr long) +36 stdcall AtlAxDialogBoxA(long str long ptr long) 37 stdcall AtlAxCreateDialogW(long wstr long ptr long) 38 stdcall AtlAxCreateDialogA(long str long ptr long) 39 stdcall AtlAxCreateControl(ptr ptr ptr ptr) 40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr) 41 stdcall AtlAxAttachControl(ptr ptr ptr) 42 stdcall AtlAxWinInit() -43 stub AtlWinModuleAddCreateWndData -44 stub AtlWinModuleExtractCreateWndData +43 stdcall AtlWinModuleAddCreateWndData(ptr ptr ptr) +44 stdcall AtlWinModuleExtractCreateWndData(ptr) 45 stub AtlWinModuleRegisterWndClassInfoW 46 stub AtlWinModuleRegisterWndClassInfoA 47 stdcall AtlAxGetControl(long ptr) 48 stdcall AtlAxGetHost(long ptr) -49 stub AtlRegisterClassCategoriesHelper +49 stdcall AtlRegisterClassCategoriesHelper(ptr ptr long) 50 stdcall AtlIPersistStreamInit_Load(ptr ptr ptr ptr) 51 stdcall AtlIPersistStreamInit_Save(ptr long ptr ptr ptr) -52 stub AtlIPersistPropertyBag_Load +52 stdcall AtlIPersistPropertyBag_Load(ptr ptr ptr ptr ptr) 53 stub AtlIPersistPropertyBag_Save -54 stub AtlGetObjectSourceInterface -56 stub AtlLoadTypeLib -58 stub AtlModuleAddTermFunc +54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr) +56 stdcall AtlLoadTypeLib(long wstr ptr ptr) +58 stdcall AtlModuleAddTermFunc(ptr ptr long) 59 stub AtlAxCreateControlLic 60 stub AtlAxCreateControlLicEx 61 stdcall AtlCreateRegistrar(ptr) 62 stub AtlWinModuleRegisterClassExW 63 stub AtlWinModuleRegisterClassExA -64 stub AtlCallTermFunc -65 stub AtlWinModuleInit +64 stdcall AtlCallTermFunc(ptr) +65 stdcall AtlWinModuleInit(ptr) 66 stub AtlWinModuleTerm -67 stub AtlSetPerUserRegistration -68 stub AtlGetPerUserRegistration +67 stdcall AtlSetPerUserRegistration(long) +68 stdcall AtlGetPerUserRegistration(ptr) Modified: trunk/reactos/dll/win32/atl100/atl_ax.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl100/atl_ax.c?…
============================================================================== --- trunk/reactos/dll/win32/atl100/atl_ax.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/atl100/atl_ax.c [iso-8859-1] Fri Sep 13 22:50:10 2013 @@ -90,7 +90,8 @@ BOOL WINAPI AtlAxWinInit(void) { WNDCLASSEXW wcex; - const WCHAR AtlAxWin[] = {'A','t','l','A','x','W','i','n',0}; + const WCHAR AtlAxWin100[] = {'A','t','l','A','x','W','i','n','1','0','0',0}; + const WCHAR AtlAxWinLic100[] = {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0}; FIXME("semi-stub\n"); @@ -98,7 +99,7 @@ return FALSE; wcex.cbSize = sizeof(wcex); - wcex.style = 0; + wcex.style = CS_GLOBALCLASS | CS_DBLCLKS; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = GetModuleHandleW( NULL ); @@ -109,7 +110,11 @@ wcex.hIconSm = 0; wcex.lpfnWndProc = AtlAxWin_wndproc; - wcex.lpszClassName = AtlAxWin; + wcex.lpszClassName = AtlAxWin100; + if ( !RegisterClassExW( &wcex ) ) + return FALSE; + + wcex.lpszClassName = AtlAxWinLic100; if ( !RegisterClassExW( &wcex ) ) return FALSE; @@ -1354,3 +1359,25 @@ return IOleObject_QueryInterface( This->control, &IID_IUnknown, (void**) pUnk ); } + +/*********************************************************************** + * AtlAxDialogBoxW [atl100.35] + * + */ +INT_PTR WINAPI AtlAxDialogBoxW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, + LPARAM dwInitParam) +{ + FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_w(lpTemplateName), hWndParent, lpDialogProc, dwInitParam); + return 0; +} + +/*********************************************************************** + * AtlAxDialogBoxA [atl100.36] + * + */ +INT_PTR WINAPI AtlAxDialogBoxA(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, + LPARAM dwInitParam) +{ + FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_a(lpTemplateName), hWndParent, lpDialogProc, dwInitParam); + return 0; +} Modified: trunk/reactos/dll/win32/atl100/registrar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl100/registrar…
============================================================================== --- trunk/reactos/dll/win32/atl100/registrar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/atl100/registrar.c [iso-8859-1] Fri Sep 13 22:50:10 2013 @@ -712,3 +712,48 @@ *ret = ®istrar->IRegistrar_iface; return S_OK; } + +/*********************************************************************** + * AtlUpdateRegistryFromResourceD [atl100.@] + */ +HRESULT WINAPI AtlUpdateRegistryFromResourceD(HINSTANCE inst, LPCOLESTR res, + BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries, IRegistrar *pReg) +{ + const struct _ATL_REGMAP_ENTRY *iter; + WCHAR module_name[MAX_PATH]; + IRegistrar *registrar; + HRESULT hres; + + static const WCHAR moduleW[] = {'M','O','D','U','L','E',0}; + static const WCHAR registryW[] = {'R','E','G','I','S','T','R','Y',0}; + + if(!GetModuleFileNameW(inst, module_name, MAX_PATH)) { + FIXME("hinst %p: did not get module name\n", inst); + return E_FAIL; + } + + TRACE("%p (%s), %s, %d, %p, %p\n", inst, debugstr_w(module_name), + debugstr_w(res), bRegister, pMapEntries, pReg); + + if(pReg) { + registrar = pReg; + }else { + hres = AtlCreateRegistrar(®istrar); + if(FAILED(hres)) + return hres; + } + + IRegistrar_AddReplacement(registrar, moduleW, module_name); + + for (iter = pMapEntries; iter && iter->szKey; iter++) + IRegistrar_AddReplacement(registrar, iter->szKey, iter->szData); + + if(bRegister) + hres = IRegistrar_ResourceRegisterSz(registrar, module_name, res, registryW); + else + hres = IRegistrar_ResourceUnregisterSz(registrar, module_name, res, registryW); + + if(registrar != pReg) + IRegistrar_Release(registrar); + return hres; +} Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Sep 13 22:50:10 2013 @@ -43,7 +43,7 @@ reactos/dll/win32/actxprxy # Synced to Wine-1.5.26 reactos/dll/win32/advpack # Synced to Wine-1.7.1 reactos/dll/win32/atl # Synced to Wine-1.5.19 -reactos/dll/win32/atl100 # Synced to Wine-1.5.19 +reactos/dll/win32/atl100 # Synced to Wine-1.7.1 reactos/dll/win32/avifil32 # Synced to Wine-1.5.26 reactos/dll/win32/bcrypt # Synced to Wine-1.5.26 reactos/dll/win32/browseui # Out of sync
11 years, 3 months
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
56
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
Results per page:
10
25
50
100
200