ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2009
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
641 discussions
Start a n
N
ew thread
[tkreuzer] 43609: add AMD64_LOADER_BLOCK, it currently contains a pointer to freeldrs debugprint function for early debugging
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Oct 19 19:06:24 2009 New Revision: 43609 URL:
http://svn.reactos.org/svn/reactos?rev=43609&view=rev
Log: add AMD64_LOADER_BLOCK, it currently contains a pointer to freeldrs debugprint function for early debugging Modified: branches/ros-amd64-bringup/reactos/include/reactos/arc/arc.h Modified: branches/ros-amd64-bringup/reactos/include/reactos/arc/arc.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/reactos/arc/arc.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/reactos/arc/arc.h [iso-8859-1] Mon Oct 19 19:06:24 2009 @@ -375,6 +375,11 @@ ULONG VirtualBias; } I386_LOADER_BLOCK, *PI386_LOADER_BLOCK; +typedef struct _AMD64_LOADER_BLOCK +{ + PVOID DbgPrint; +} AMD64_LOADER_BLOCK, *PAMD64_LOADER_BLOCK; + typedef struct _PPC_LOADER_BLOCK { PVOID BootInfo; @@ -477,6 +482,7 @@ union { I386_LOADER_BLOCK I386; + AMD64_LOADER_BLOCK Amd64; ALPHA_LOADER_BLOCK Alpha; IA64_LOADER_BLOCK IA64; PPC_LOADER_BLOCK PowerPC;
15 years, 2 months
1
0
0
0
[cwittich] 43608: -sync jscript_winetest with wine 1.1.31
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Oct 19 19:03:40 2009 New Revision: 43608 URL:
http://svn.reactos.org/svn/reactos?rev=43608&view=rev
Log: -sync jscript_winetest with wine 1.1.31 Modified: trunk/rostests/winetests/jscript/api.js trunk/rostests/winetests/jscript/jscript.c trunk/rostests/winetests/jscript/lang.js trunk/rostests/winetests/jscript/regexp.js trunk/rostests/winetests/jscript/run.c Modified: trunk/rostests/winetests/jscript/api.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/api.js?…
============================================================================== --- trunk/rostests/winetests/jscript/api.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/api.js [iso-8859-1] Mon Oct 19 19:03:40 2009 @@ -58,6 +58,32 @@ tmp = encodeURI("abc", "test"); ok(tmp === "abc", "encodeURI('abc') = " + tmp); +tmp = escape("abc"); +ok(tmp === "abc", "escape('abc') = " + tmp); +tmp = escape(""); +ok(tmp === "", "escape('') = " + tmp); +tmp = escape("a1b c!d+e(a)*-_+./,"); +ok(tmp === "a1b%20c%21d+e(a)*-_+./%2C", "escape('a1b c!d+e(a)*-_+./,') = " + tmp); +tmp = escape(); +ok(tmp === "undefined", "escape() = " + tmp); +tmp = escape('\u1234\123\xf3'); +ok(tmp == "%u1234S%F3", "escape('\u1234\123\xf3') = " + tmp); + +tmp = unescape("abc"); +ok(tmp === "abc", "unescape('abc') = " + tmp); +tmp = unescape(""); +ok(tmp === "", "unescape('') = " + tmp); +tmp = unescape("%%%"); +ok(tmp === "%%%", "unescape('%%%') = " + tmp); +tmp = unescape(); +ok(tmp === "undefined", "unescape() = " + tmp); +tmp = unescape("%54%65s%u0074"); +ok(tmp === "Test", "unescape('%54%65s%u0074') = " + tmp); + +tmp = "aA1~`!@#$%^&*()_+=-][{}';:/.,<>?\|"; +ok(escape(tmp) === "aA1%7E%60%21(a)%23%24%25%5E%26*%28%29_+%3D-%5D%5B%7B%7D%27%3B%3A/.%2C%3C%3E%3F%7C", "escape('" + tmp + "') = " + escape(tmp)); +ok(unescape(escape(tmp)) === tmp, "unescape(escape('" + tmp + "')) = " + unescape(escape(tmp))); + tmp = "" + new Object(); ok(tmp === "[object Object]", "'' + new Object() = " + tmp); (tmp = new Array).f = Object.prototype.toString; @@ -76,6 +102,23 @@ ok(tmp.f() === "[object RegExp]", "tmp.f() = " + tmp.f()); (tmp = new String).f = Object.prototype.toString; ok(tmp.f() === "[object String]", "tmp.f() = " + tmp.f()); +tmp = Object.prototype.toString.call(testObj); +ok(tmp === "[object Object]", "toString.call(testObj) = " + tmp); +tmp = Object.prototype.toString.call(this); +ok(tmp === "[object Object]", "toString.call(this) = " + tmp); +(function () { tmp = Object.prototype.toString.call(arguments); })(); +ok(tmp === "[object Object]", "toString.call(arguments) = " + tmp); + +ok(Object(1) instanceof Number, "Object(1) is not instance of Number"); +ok(Object("") instanceof String, "Object('') is not instance of String"); +ok(Object(false) instanceof Boolean, "Object(false) is not instance of Boolean"); + +obj = new Object(); +ok(Object(obj) === obj, "Object(obj) !== obj"); + +ok(typeof(Object()) === "object", "typeof(Object()) !== 'object'"); +ok(typeof(Object(undefined)) === "object", "typeof(Object(undefined)) !== 'object'"); +ok(typeof(Object(null)) === "object", "typeof(Object(null)) !== 'object'"); var obj = new Object(); obj.toString = function (x) { @@ -84,6 +127,7 @@ }; ok((tmp = obj.toLocaleString()) === "test", "obj.toLocaleString() = " + tmp); ok((tmp = obj.toLocaleString(1)) === "test", "obj.toLocaleString(1) = " + tmp); +ok(obj === obj.valueOf(), "obj !== obj.valueOf"); ok("".length === 0, "\"\".length = " + "".length); ok(getVT("".length) == "VT_I4", "\"\".length = " + "".length); @@ -110,6 +154,11 @@ ok(str.toString() === "", "str.toString() = " + str.toString()); var str = new String("test", "abc"); ok(str.toString() === "test", "str.toString() = " + str.toString()); + +var strObj = new Object(); +strObj.toString = function() { return "abcd" }; +strObj.substr = String.prototype.substr; +strObj.lastIndexOf = String.prototype.lastIndexOf; tmp = "value " + str; ok(tmp === "value test", "'value ' + str = " + tmp); @@ -154,6 +203,12 @@ ok(tmp === 0x62, "'abc'.charCodeAt(true) = " + tmp); tmp = "abc".charCodeAt(0,2); ok(tmp === 0x61, "'abc'.charCodeAt(0,2) = " + tmp); +tmp = "\u49F4".charCodeAt(0); +ok(tmp === 0x49F4, "'\u49F4'.charCodeAt(0) = " + tmp); +tmp = "\052".charCodeAt(0); +ok(tmp === 0x2A, "'\052'.charCodeAt(0) = " + tmp); +tmp = "\xa2".charCodeAt(0); +ok(tmp === 0xA2, "'\xa2'.charCodeAt(0) = " + tmp); tmp = "abcd".substring(1,3); ok(tmp === "bc", "'abcd'.substring(1,3) = " + tmp); @@ -172,6 +227,25 @@ tmp = "abcd".substring(); ok(tmp === "abcd", "'abcd'.substring() = " + tmp); +tmp = "abcd".substr(1,3); +ok(tmp === "bcd", "'abcd'.substr(1,3) = " + tmp); +tmp = "abcd".substr(-1,3); +ok(tmp === "abc", "'abcd'.substr(-1,3) = " + tmp); +tmp = "abcd".substr(1,6); +ok(tmp === "bcd", "'abcd'.substr(1,6) = " + tmp); +tmp = "abcd".substr(2,-1); +ok(tmp === "", "'abcd'.substr(3,1) = " + tmp); +tmp = "abcd".substr(2,0); +ok(tmp === "", "'abcd'.substr(2,2) = " + tmp); +tmp = "abcd".substr(true,"3"); +ok(tmp === "bcd", "'abcd'.substr(true,'3') = " + tmp); +tmp = "abcd".substr(1,3,2); +ok(tmp === "bcd", "'abcd'.substr(1,3,2) = " + tmp); +tmp = "abcd".substr(); +ok(tmp === "abcd", "'abcd'.substr() = " + tmp); +tmp = strObj.substr(1,1); +ok(tmp === "b", "'abcd'.substr(1,3) = " + tmp); + tmp = "abcd".slice(1,3); ok(tmp === "bc", "'abcd'.slice(1,3) = " + tmp); tmp = "abcd".slice(1,-1); @@ -271,6 +345,25 @@ tmp = "abcd".indexOf(); ok(tmp == -1, "indexOf = " + tmp); +tmp = "abcd".lastIndexOf("bc",1); +ok(tmp === 1, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf("bc",2); +ok(tmp === 1, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf("bc"); +ok(tmp === 1, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf("ac"); +ok(tmp === -1, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf("d",10); +ok(tmp === 3, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf("bc",0,"test"); +ok(tmp === -1, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf(); +ok(tmp === -1, "lastIndexOf = " + tmp); +tmp = "aaaa".lastIndexOf("a",2); +ok(tmp == 2, "lastIndexOf = " + tmp); +tmp = strObj.lastIndexOf("b"); +ok(tmp === 1, "lastIndexOf = " + tmp); + tmp = "".toLowerCase(); ok(tmp === "", "''.toLowerCase() = " + tmp); tmp = "test".toLowerCase(); @@ -460,6 +553,19 @@ ok(typeof(arr) === "object", "arr (6) is not object"); ok((arr.length === 6), "arr.length is not 6"); ok(arr["0"] === undefined, "arr[0] is not undefined"); + +ok(arr.push() === 6, "arr.push() !== 6"); +ok(arr.push(1) === 7, "arr.push(1) !== 7"); +ok(arr[6] === 1, "arr[6] != 1"); +ok(arr.length === 7, "arr.length != 10"); +ok(arr.push(true, 'b', false) === 10, "arr.push(true, 'b', false) !== 10"); +ok(arr[8] === "b", "arr[8] != 'b'"); +ok(arr.length === 10, "arr.length != 10"); + +var arr = new Object(); +arr.push = Array.prototype.push; + +arr.length = 6; ok(arr.push() === 6, "arr.push() !== 6"); ok(arr.push(1) === 7, "arr.push(1) !== 7"); @@ -538,6 +644,64 @@ ok(arr.valueOf === Object.prototype.valueOf, "arr.valueOf !== Object.prototype.valueOf"); ok(arr === arr.valueOf(), "arr !== arr.valueOf"); +arr = [1,2,3]; +tmp = arr.unshift(0); +ok(tmp === undefined, "[1,2,3].unshift(0) returned " +tmp); +ok(arr.length === 4, "arr.length = " + arr.length); +ok(arr.toString() === "0,1,2,3", "arr.toString() = " + arr.toString()); + +arr = new Array(3); +arr[0] = 1; +arr[2] = 3; +tmp = arr.unshift(-1,0); +ok(tmp === undefined, "unshift returned " +tmp); +ok(arr.length === 5, "arr.length = " + arr.length); +ok(arr.toString() === "-1,0,1,,3", "arr.toString() = " + arr.toString()); + +arr = [1,2,3]; +tmp = arr.unshift(); +ok(tmp === undefined, "unshift returned " +tmp); +ok(arr.length === 3, "arr.length = " + arr.length); +ok(arr.toString() === "1,2,3", "arr.toString() = " + arr.toString()); + +arr = new Object(); +arr.length = 2; +arr[0] = 1; +arr[1] = 2; +tmp = Array.prototype.unshift.call(arr, 0); +ok(tmp === undefined, "unshift returned " +tmp); +ok(arr.length === 3, "arr.length = " + arr.length); +ok(arr[0] === 0 && arr[1] === 1 && arr[2] === 2, "unexpected array"); + +arr = [1,2,,4]; +tmp = arr.shift(); +ok(tmp === 1, "[1,2,,4].shift() = " + tmp); +ok(arr.toString() === "2,,4", "arr = " + arr.toString()); + +arr = []; +tmp = arr.shift(); +ok(tmp === undefined, "[].shift() = " + tmp); +ok(arr.toString() === "", "arr = " + arr.toString()); + +arr = [1,2,,4]; +tmp = arr.shift(2); +ok(tmp === 1, "[1,2,,4].shift(2) = " + tmp); +ok(arr.toString() === "2,,4", "arr = " + arr.toString()); + +arr = [1,]; +tmp = arr.shift(); +ok(tmp === 1, "[1,].shift() = " + tmp); +ok(arr.toString() === "", "arr = " + arr.toString()); + +obj = new Object(); +obj[0] = "test"; +obj[2] = 3; +obj.length = 3; +tmp = Array.prototype.shift.call(obj); +ok(tmp === "test", "obj.shift() = " + tmp); +ok(obj.length == 2, "obj.length = " + obj.length); +ok(obj[1] === 3, "obj[1] = " + obj[1]); + var num = new Number(6); arr = [0,1,2]; tmp = arr.concat(3, [4,5], num); @@ -572,6 +736,87 @@ ok(arr.slice(5).toString() === "a,,,,,,,2", "arr.slice(5).toString() = " + arr.slice(5).toString()); ok(arr.slice(5).length === 8, "arr.slice(5).length = " + arr.slice(5).length); +arr = [1,2,3,4,5]; +tmp = arr.splice(2,2); +ok(tmp.toString() == "3,4", "arr.splice(2,2) returned " + tmp.toString()); +ok(arr.toString() == "1,2,5", "arr.splice(2,2) is " + arr.toString()); + +arr = [1,2,3,4,5]; +tmp = arr.splice(2,2,"a"); +ok(tmp.toString() == "3,4", "arr.splice(2,2,'a') returned " + tmp.toString()); +ok(arr.toString() == "1,2,a,5", "arr.splice(2,2,'a') is " + arr.toString()); + +arr = [1,2,3,4,5]; +tmp = arr.splice(2,2,'a','b','c'); +ok(tmp.toString() == "3,4", "arr.splice(2,2,'a','b','c') returned " + tmp.toString()); +ok(arr.toString() == "1,2,a,b,c,5", "arr.splice(2,2,'a','b','c') is " + arr.toString()); + +arr = [1,2,3,4,]; +tmp = arr.splice(2,2,'a','b','c'); +ok(tmp.toString() == "3,4", "arr.splice(2,2,'a','b','c') returned " + tmp.toString()); +ok(arr.toString() == "1,2,a,b,c,", "arr.splice(2,2,'a','b','c') is " + arr.toString()); + +arr = [1,2,3,4,]; +arr.splice(2,2,'a','b','c'); +ok(arr.toString() == "1,2,a,b,c,", "arr.splice(2,2,'a','b','c') is " + arr.toString()); + +arr = [1,2,3,4,5]; +tmp = arr.splice(2,2,'a','b'); +ok(tmp.toString() == "3,4", "arr.splice(2,2,'a','b') returned " + tmp.toString()); +ok(arr.toString() == "1,2,a,b,5", "arr.splice(2,2,'a','b') is " + arr.toString()); + +arr = [1,2,3,4,5]; +tmp = arr.splice(-1,2); +ok(tmp.toString() == "5", "arr.splice(-1,2) returned " + tmp.toString()); +ok(arr.toString() == "1,2,3,4", "arr.splice(-1,2) is " + arr.toString()); + +arr = [1,2,3,4,5]; +tmp = arr.splice(-10,3); +ok(tmp.toString() == "1,2,3", "arr.splice(-10,3) returned " + tmp.toString()); +ok(arr.toString() == "4,5", "arr.splice(-10,3) is " + arr.toString()); + +arr = [1,2,3,4,5]; +tmp = arr.splice(-10,100); +ok(tmp.toString() == "1,2,3,4,5", "arr.splice(-10,100) returned " + tmp.toString()); +ok(arr.toString() == "", "arr.splice(-10,100) is " + arr.toString()); + +arr = [1,2,3,4,5]; +tmp = arr.splice(2,-1); +ok(tmp.toString() == "", "arr.splice(2,-1) returned " + tmp.toString()); +ok(arr.toString() == "1,2,3,4,5", "arr.splice(2,-1) is " + arr.toString()); + +arr = [1,2,3,4,5]; +tmp = arr.splice(2); +ok(tmp.toString() == "", "arr.splice(2,-1) returned " + tmp.toString()); +ok(arr.toString() == "1,2,3,4,5", "arr.splice(2,-1) is " + arr.toString()); + +arr = [1,2,3,4,5]; +tmp = arr.splice(); +ok(tmp.toString() == "", "arr.splice(2,-1) returned " + tmp.toString()); +ok(arr.toString() == "1,2,3,4,5", "arr.splice(2,-1) is " + arr.toString()); + +obj = new Object(); +obj.length = 3; +obj[0] = 1; +obj[1] = 2; +obj[2] = 3; +tmp = Array.prototype.splice.call(obj, 1, 1, 'a', 'b'); +ok(tmp.toString() === "2", "obj.splice returned " + tmp); +ok(obj.length === 4, "obj.length = " + obj.length); +ok(obj[0] === 1, "obj[0] = " + obj[0]); +ok(obj[1] === 'a', "obj[1] = " + obj[1]); +ok(obj[2] === 'b', "obj[2] = " + obj[2]); +ok(obj[3] === 3, "obj[3] = " + obj[3]); + +obj = new Object(); +obj.length = 3; +obj[0] = 1; +obj[1] = 2; +obj[2] = 3; +tmp = Array.prototype.slice.call(obj, 1, 2); +ok(tmp.length === 1, "tmp.length = " + tmp.length); +ok(tmp[0] === 2, "tmp[0] = " + tmp[0]); + var num = new Number(2); ok(num.toString() === "2", "num(2).toString !== 2"); var num = new Number(); @@ -1101,6 +1346,41 @@ "testFuncToString.toString() = " + testFuncToString.toString()); ok("" + testFuncToString === "function testFuncToString(x,y) {\n return x+y;\n}", "'' + testFuncToString = " + testFuncToString); + +tmp = new Object(); + +function callTest(argc) { + ok(this === tmp, "this !== tmp\n"); + ok(arguments.length === argc+1, "arguments.length = " + arguments.length + " expected " + (argc+1)); + for(var i=1; i <= argc; i++) + ok(arguments[i] === i, "arguments[i] = " + arguments[i]); +} + +callTest.call(tmp, 1, 1); +callTest.call(tmp, 2, 1, 2); + +callTest.apply(tmp, [1, 1]); +callTest.apply(tmp, [2, 1, 2]); +(function () { callTest.apply(tmp, arguments); })(2,1,2); + +function callTest2() { + ok(this === tmp, "this !== tmp\n"); + ok(arguments.length === 0, "callTest2: arguments.length = " + arguments.length + " expected 0"); +} + +callTest2.call(tmp); +callTest2.apply(tmp, []); +callTest2.apply(tmp); +(function () { callTest2.apply(tmp, arguments); })(); + +function callTest3() { + ok(arguments.length === 0, "arguments.length = " + arguments.length + " expected 0"); +} + +callTest3.call(); + +tmp = Number.prototype.toString.call(3); +ok(tmp === "3", "Number.prototype.toString.call(3) = " + tmp); var date = new Date(); @@ -1255,12 +1535,26 @@ Math.SQRT1_2 = "test"; ok(Math.floor(Math.SQRT1_2*100) === 70, "modified Math.SQRT1_2 = " + Math.SQRT1_2); +ok(isNaN.toString() === "\nfunction isNaN() {\n [native code]\n}\n", + "isNaN.toString = '" + isNaN.toString() + "'"); +ok(Array.toString() === "\nfunction Array() {\n [native code]\n}\n", + "isNaN.toString = '" + Array.toString() + "'"); +ok(Function.toString() === "\nfunction Function() {\n [native code]\n}\n", + "isNaN.toString = '" + Function.toString() + "'"); +ok(Function.prototype.toString() === "\nfunction prototype() {\n [native code]\n}\n", + "isNaN.toString = '" + Function.prototype.toString() + "'"); +ok("".substr.toString() === "\nfunction substr() {\n [native code]\n}\n", + "''.substr.toString = '" + "".substr.toString() + "'"); + var bool = new Boolean(); ok(bool.toString() === "false", "bool.toString() = " + bool.toString()); var bool = new Boolean("false"); ok(bool.toString() === "true", "bool.toString() = " + bool.toString()); ok(bool.valueOf() === Boolean(1), "bool.valueOf() = " + bool.valueOf()); ok(bool.toLocaleString() === bool.toString(), "bool.toLocaleString() = " + bool.toLocaleString()); + +ok(ActiveXObject instanceof Function, "ActiveXObject is not instance of Function"); +ok(ActiveXObject.prototype instanceof Object, "ActiveXObject.prototype is not instance of Object"); ok(Error.prototype !== TypeError.prototype, "Error.prototype === TypeError.prototype"); ok(RangeError.prototype !== TypeError.prototype, "RangeError.prototype === TypeError.prototype"); @@ -1352,8 +1646,94 @@ exception_test(function() {eval("while(")}, "SyntaxError", -2146827286); exception_test(function() {eval("if(")}, "SyntaxError", -2146827286); exception_test(function() {eval("'unterminated")}, "SyntaxError", -2146827273); - -function testObjectInherit(obj, ts, tls, vo) { +exception_test(function() {eval("nonexistingfunc()")}, "TypeError", -2146823281); +exception_test(function() {RegExp(/a/, "g");}, "RegExpError", -2146823271); + +function testThisExcept(func, number) { + exception_test(function() {func.call(new Object())}, "TypeError", number); +} + +function testBoolThis(func) { + testThisExcept(Boolean.prototype[func], -2146823278); +} + +testBoolThis("toString"); +testBoolThis("valueOf"); + +function testDateThis(func) { + testThisExcept(Date.prototype[func], -2146823282); +} + +testDateThis("getDate"); +testDateThis("getDay"); +testDateThis("getFullYear"); +testDateThis("getHours"); +testDateThis("getMilliseconds"); +testDateThis("getMinutes"); +testDateThis("getMonth"); +testDateThis("getSeconds"); +testDateThis("getTime"); +testDateThis("getTimezoneOffset"); +testDateThis("getUTCDate"); +testDateThis("getUTCDay"); +testDateThis("getUTCFullYear"); +testDateThis("getUTCHours"); +testDateThis("getUTCMilliseconds"); +testDateThis("getUTCMinutes"); +testDateThis("getUTCMonth"); +testDateThis("getUTCSeconds"); +testDateThis("setDate"); +testDateThis("setFullYear"); +testDateThis("setHours"); +testDateThis("setMilliseconds"); +testDateThis("setMinutes"); +testDateThis("setMonth"); +testDateThis("setSeconds"); +testDateThis("setTime"); +testDateThis("setUTCDate"); +testDateThis("setUTCFullYear"); +testDateThis("setUTCHours"); +testDateThis("setUTCMilliseconds"); +testDateThis("setUTCMinutes"); +testDateThis("setUTCMonth"); +testDateThis("setUTCSeconds"); +testDateThis("toDateString"); +testDateThis("toLocaleDateString"); +testDateThis("toLocaleString"); +testDateThis("toLocaleTimeString"); +testDateThis("toString"); +testDateThis("toTimeString"); +testDateThis("toUTCString"); +testDateThis("valueOf"); + +function testArrayThis(func) { + testThisExcept(Array.prototype[func], -2146823257); +} + +testArrayThis("toString"); + +function testFunctionThis(func) { + testThisExcept(Function.prototype[func], -2146823286); +} + +testFunctionThis("toString"); +testFunctionThis("call"); +testFunctionThis("apply"); + +function testArrayHostThis(func) { + exception_test(function() { Array.prototype[func].call(testObj); }, "TypeError", -2146823274); +} + +testArrayHostThis("push"); +testArrayHostThis("shift"); +testArrayHostThis("slice"); +testArrayHostThis("splice"); +testArrayHostThis("unshift"); + +function testObjectInherit(obj, constr, ts, tls, vo) { + ok(obj instanceof Object, "obj is not instance of Object"); + ok(obj instanceof constr, "obj is not instance of its constructor"); + ok(obj.hasOwnProperty === Object.prototype.hasOwnProperty, "obj.hasOwnProperty !== Object.prototype.hasOwnProprty"); ok(obj.isPrototypeOf === Object.prototype.isPrototypeOf, @@ -1386,15 +1766,17 @@ } Object.prototype._test = "test"; -testObjectInherit(new String("test"), false, true, false); -testObjectInherit(/test/g, false, true, true); -testObjectInherit(new Number(1), false, false, false); -testObjectInherit(new Date(), false, false, false); -testObjectInherit(new Boolean(true), false, true, false); -testObjectInherit(new Array(), false, false, true); -testObjectInherit(new Error(), false, true, true); -testObjectInherit(testObjectInherit, false, true, true); -testObjectInherit(Math, true, true, true); +testObjectInherit(new String("test"), String, false, true, false); +testObjectInherit(/test/g, RegExp, false, true, true); +testObjectInherit(new Number(1), Number, false, false, false); +testObjectInherit(new Date(), Date, false, false, false); +testObjectInherit(new Boolean(true), Boolean, false, true, false); +testObjectInherit(new Array(), Array, false, false, true); +testObjectInherit(new Error(), Error, false, true, true); +testObjectInherit(testObjectInherit, Function, false, true, true); +testObjectInherit(Math, Object, true, true, true); + +(function() { testObjectInherit(arguments, Object, true, true, true); })(); function testFunctions(obj, arr) { var l; @@ -1500,6 +1882,7 @@ ["toString", 0], ["toTimeString", 0], ["toUTCString", 0], + ["toGMTString", 0], ["valueOf", 0] ]); @@ -1552,4 +1935,10 @@ ["valueOf", 0] ]); +testFunctions(Function.prototype, [ + ["apply", 2], + ["call", 1], + ["toString", 0] + ]); + reportSuccess(); Modified: trunk/rostests/winetests/jscript/jscript.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/jscript…
============================================================================== --- trunk/rostests/winetests/jscript/jscript.c [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/jscript.c [iso-8859-1] Mon Oct 19 19:03:40 2009 @@ -67,6 +67,18 @@ DEFINE_EXPECT(OnStateChange_INITIALIZED); DEFINE_EXPECT(OnEnterScript); DEFINE_EXPECT(OnLeaveScript); + +static BSTR a2bstr(const char *str) +{ + BSTR ret; + int len; + + len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); + ret = SysAllocStringLen(NULL, len-1); + MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len); + + return ret; +} #define test_state(s,ss) _test_state(__LINE__,s,ss) static void _test_state(unsigned line, IActiveScript *script, SCRIPTSTATE exstate) @@ -195,6 +207,8 @@ { IDispatchEx *dispex; IDispatch *disp; + BSTR str; + DISPID id; HRESULT hres; disp = (void*)0xdeadbeef; @@ -213,6 +227,11 @@ hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); IDispatch_Release(disp); ok(hres == S_OK, "Could not get IDispatchEx interface: %08x\n", hres); + + str = a2bstr("ActiveXObject"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID failed: %08x\n", hres); IDispatchEx_Release(dispex); } Modified: trunk/rostests/winetests/jscript/lang.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/lang.js…
============================================================================== --- trunk/rostests/winetests/jscript/lang.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/lang.js [iso-8859-1] Mon Oct 19 19:03:40 2009 @@ -35,7 +35,7 @@ ok(!(undefined === null), "!(undefined === null) is false"); ok(1E0 === 1, "1E0 === 1 is false"); ok(1000000*1000000 === 1000000000000, "1000000*1000000 === 1000000000000 is false"); -ok(8.64e15 === 8640000000000000, "8.64e15 !== 8640000000000000"+8.64e15); +ok(8.64e15 === 8640000000000000, "8.64e15 !== 8640000000000000"); ok(1e2147483648 === Infinity, "1e2147483648 !== Infinity"); ok(1 !== 2, "1 !== 2 is false"); @@ -63,11 +63,12 @@ function testFunc1(x, y) { ok(this !== undefined, "this is undefined"); - ok(x === true, "x is not 1"); + ok(x === true, "x is not true"); ok(y === "test", "y is not \"test\""); ok(arguments.length === 2, "arguments.length is not 2"); ok(arguments["0"] === true, "arguments[0] is not true"); ok(arguments["1"] === "test", "arguments[1] is not \"test\""); + ok(arguments.callee === testFunc1, "arguments.calee !== testFunc1"); return true; } @@ -116,6 +117,7 @@ ok(this.test === true, "this.test is not true"); ok(arguments.length === 1, "arguments.length is not 1"); ok(arguments["0"] === true, "arguments[0] is not true"); + ok(typeof(arguments.callee) === "function", "typeof(arguments.calee) = " + typeof(arguments.calee)); return "test"; }; @@ -128,6 +130,7 @@ ok(this !== undefined, "this is undefined"); ok(arguments.length === 1, "arguments.length is not 1"); ok(arguments["0"] === true, "arguments[0] is not 1"); + ok(arguments.callee === testConstr1, "arguments.calee !== testConstr1"); return false; } @@ -386,9 +389,9 @@ ok(+"3e3" === 3000, "+'3e3' !== 3000"); tmp = new Number(1); -ok(+tmp === 1, "ToNumber(new Number(1)) = " + (+tmp)); +ok(+tmp === 1, "+(new Number(1)) = " + (+tmp)); tmp = new String("1"); -ok(+tmp === 1, "ToNumber(new String('1')) = " + (+tmp)); +ok(+tmp === 1, "+(new String('1')) = " + (+tmp)); ok("" + 0 === "0", "\"\" + 0 !== \"0\""); ok("" + 123 === "123", "\"\" + 123 !== \"123\""); @@ -462,7 +465,7 @@ ok(state === "", "try: state = " + state); state = "try"; }finally { - ok(state === "try", "funally: state = " + state); + ok(state === "try", "finally: state = " + state); state = "finally"; } ok(state === "finally", "state = " + state + " expected finally"); @@ -474,7 +477,7 @@ }catch(ex) { ok(false, "unexpected catch"); }finally { - ok(state === "try", "funally: state = " + state); + ok(state === "try", "finally: state = " + state); state = "finally"; } ok(state === "finally", "state = " + state + " expected finally"); @@ -501,7 +504,7 @@ ok(ex === true, "ex is not true"); state = "catch"; }finally { - ok(state === "catch", "funally: state = " + state); + ok(state === "catch", "finally: state = " + state); state = "finally"; } ok(state === "finally", "state = " + state + " expected finally"); @@ -516,7 +519,7 @@ ok(ex === true, "ex is not true"); state = "catch"; }finally { - ok(state === "catch", "funally: state = " + state); + ok(state === "catch", "finally: state = " + state); state = "finally"; } ok(state === "finally", "state = " + state + " expected finally"); @@ -531,7 +534,7 @@ ok(ex === true, "ex is not true"); state = "catch"; }finally { - ok(state === "catch", "funally: state = " + state); + ok(state === "catch", "finally: state = " + state); state = "finally"; } ok(state === "finally", "state = " + state + " expected finally"); @@ -550,7 +553,7 @@ ok(ex === true, "ex is not true"); state = "catch"; }finally { - ok(state === "catch", "funally: state = " + state); + ok(state === "catch", "finally: state = " + state); state = "finally"; } ok(state === "finally", "state = " + state + " expected finally"); @@ -622,7 +625,7 @@ ok(ex === true, "ex is not true"); state = "catch"; }finally { - ok(state === "catch", "funally: state = " + state); + ok(state === "catch", "finally: state = " + state); state = "finally"; } ok(state === "finally", "state = " + state + " expected finally"); @@ -796,6 +799,38 @@ else ok(true, "else should be associated with nearest if statement"); +function instanceOfTest() {} +tmp = new instanceOfTest(); + +ok((tmp instanceof instanceOfTest) === true, "tmp is not instance of instanceOfTest"); +ok((tmp instanceof Object) === true, "tmp is not instance of Object"); +ok((tmp instanceof String) === false, "tmp is instance of String"); + +instanceOfTest.prototype = new Object(); +ok((tmp instanceof instanceOfTest) === false, "tmp is instance of instanceOfTest"); +ok((tmp instanceof Object) === true, "tmp is not instance of Object"); + +ok((1 instanceof Object) === false, "1 is instance of Object"); +ok((false instanceof Boolean) === false, "false is instance of Boolean"); +ok(("" instanceof Object) === false, "'' is instance of Object"); + +(function () { + ok((arguments instanceof Object) === true, "argument is not instance of Object"); + ok((arguments instanceof Array) === false, "argument is not instance of Array"); + ok(arguments.toString() === "[object Object]", "arguments.toString() = " + arguments.toString()); +})(1,2); + +obj = new String(); +ok(("length" in obj) === true, "length is not in obj"); +ok(("isPrototypeOf" in obj) === true, "isPrototypeOf is not in obj"); +ok(("abc" in obj) === false, "test is in obj"); +obj.abc = 1; +ok(("abc" in obj) === true, "test is not in obj"); +ok(("1" in obj) === false, "1 is in obj"); + +obj = [1,2,3]; +ok((1 in obj) === true, "1 is not in obj"); + ok(isNaN(NaN) === true, "isNaN(NaN) !== true"); ok(isNaN(0.5) === false, "isNaN(0.5) !== false"); ok(isNaN(Infinity) === false, "isNaN(Infinity) !== false"); @@ -805,8 +840,8 @@ ok(isNaN(+undefined) === true, "isNaN(+undefined) !== true"); ok(isFinite(0.5) === true, "isFinite(0.5) !== true"); -ok(isFinite(Infinity) === false, "isFinite(Infinity) !== fals"); -ok(isFinite(-Infinity) === false, "isFinite(Infinity) !== fals"); +ok(isFinite(Infinity) === false, "isFinite(Infinity) !== false"); +ok(isFinite(-Infinity) === false, "isFinite(Infinity) !== false"); ok(isFinite(NaN) === false, "isFinite(NaN) !== false"); ok(isFinite(0.5, NaN) === true, "isFinite(0.5, NaN) !== true"); ok(isFinite(NaN, 0.5) === false, "isFinite(NaN, 0.5) !== false"); @@ -896,6 +931,42 @@ ok((function (){return 1;})() === 1, "(function (){return 1;})() = " + (function (){return 1;})()); +var re = /=(\?|%3F)/g; +ok(re.source === "=(\\?|%3F)", "re.source = " + re.source); + ok(createNullBSTR() === '', "createNullBSTR() !== ''"); +ok(getVT(nullDisp) === "VT_DISPATCH", "getVT(nullDisp) = " + getVT(nullDisp)); +ok(typeof(nullDisp) === "object", "typeof(nullDisp) = " + typeof(nullDisp)); +ok(nullDisp === nullDisp, "nullDisp !== nullDisp"); +ok(nullDisp !== re, "nullDisp === re"); +ok(nullDisp === null, "nullDisp === null"); +ok(nullDisp == null, "nullDisp == null"); +ok(getVT(true && nullDisp) === "VT_DISPATCH", + "getVT(0 && nullDisp) = " + getVT(true && nullDisp)); +ok(!nullDisp === true, "!nullDisp = " + !nullDisp); +ok(String(nullDisp) === "null", "String(nullDisp) = " + String(nullDisp)); +ok(nullDisp != new Object(), "nullDisp == new Object()"); +ok(new Object() != nullDisp, "new Object() == nullDisp"); +ok((typeof Object(nullDisp)) === "object", "typeof Object(nullDisp) !== 'object'"); +tmp = getVT(Object(nullDisp)); +ok(tmp === "VT_DISPATCH", "getVT(Object(nullDisp) = " + tmp); +tmp = Object(nullDisp).toString(); +ok(tmp === "[object Object]", "Object(nullDisp).toString() = " + tmp); + +function do_test() {} +function nosemicolon() {} nosemicolon(); +function () {} nosemicolon(); + +if(false) { + function in_if_false() { return true; } ok(false, "!?"); +} + +ok(in_if_false(), "in_if_false failed"); + +ok(typeof(doesnotexist) === "undefined", "typeof(doesnotexist) = " + typeof(doesnotexist)); + +(function() { newValue = 1; })(); +ok(newValue === 1, "newValue = " + newValue); + reportSuccess(); Modified: trunk/rostests/winetests/jscript/regexp.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/regexp.…
============================================================================== --- trunk/rostests/winetests/jscript/regexp.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/regexp.js [iso-8859-1] Mon Oct 19 19:03:40 2009 @@ -17,7 +17,79 @@ */ -var m; +var m, re, b; + +re = /a+/; +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); + +m = re.exec(" aabaaa"); +ok(re.lastIndex === 3, "re.lastIndex = " + re.lastIndex); +ok(m.index === 1, "m.index = " + m.index); +ok(m.input === " aabaaa", "m.input = " + m.input); +ok(m.length === 1, "m.length = " + m.length); +ok(m[0] === "aa", "m[0] = " + m[0]); + +m = re.exec(" aabaaa"); +ok(re.lastIndex === 3, "re.lastIndex = " + re.lastIndex); +ok(m.index === 1, "m.index = " + m.index); +ok(m.input === " aabaaa", "m.input = " + m.input); +ok(m.length === 1, "m.length = " + m.length); +ok(m[0] === "aa", "m[0] = " + m[0]); + +re = /a+/g; +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); + +m = re.exec(" aabaaa"); +ok(re.lastIndex === 3, "re.lastIndex = " + re.lastIndex); +ok(m.index === 1, "m.index = " + m.index); +ok(m.input === " aabaaa", "m.input = " + m.input); +ok(m.length === 1, "m.length = " + m.length); +ok(m[0] === "aa", "m[0] = " + m[0]); + +m = re.exec(" aabaaa"); +ok(re.lastIndex === 7, "re.lastIndex = " + re.lastIndex); +ok(m.index === 4, "m.index = " + m.index); +ok(m.input === " aabaaa", "m.input = " + m.input); +ok(m.length === 1, "m.length = " + m.length); +ok(m[0] === "aaa", "m[0] = " + m[0]); + +m = re.exec(" aabaaa"); +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); +ok(m === null, "m is not null"); + +re.exec(" a"); +ok(re.lastIndex === 16, "re.lastIndex = " + re.lastIndex); + +m = re.exec(" a"); +ok(m === null, "m is not null"); +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); + +m = re.exec(" a"); +ok(re.lastIndex === 2, "re.lastIndex = " + re.lastIndex); + +m = re.exec(); +ok(m === null, "m is not null"); +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); + +b = re.test(" a "); +ok(b === true, "re.test(' a ') returned " + b); +ok(re.lastIndex === 3, "re.lastIndex = " + re.lastIndex); + +b = re.test(" a "); +ok(b === false, "re.test(' a ') returned " + b); +ok(re.lastIndex === 0, "re.lastIndex = " + re.lastIndex); + +re = /\[([^\[]+)\]/g; +m = re.exec(" [test] "); +ok(re.lastIndex === 7, "re.lastIndex = " + re.lastIndex); +ok(m.index === 1, "m.index = " + m.index); +ok(m.input === " [test] ", "m.input = " + m.input); +ok(m.length === 2, "m.length = " + m.length); +ok(m[0] === "[test]", "m[0] = " + m[0]); +ok(m[1] === "test", "m[1] = " + m[1]); + +b = /a*/.test(); +ok(b === true, "/a*/.test() returned " + b); m = "abcabc".match(/ca/); ok(typeof(m) === "object", "typeof m is not object"); @@ -208,12 +280,22 @@ ok(r[0] === "1", "r[0] = " + r[0]); ok(r[1] === "2", "r[1] = " + r[1]); -var re; - re = /abc[^d]/g; ok(re.source === "abc[^d]", "re.source = '" + re.source + "', expected 'abc[^d]'"); re = /a\bc[^d]/g; ok(re.source === "a\\bc[^d]", "re.source = '" + re.source + "', expected 'a\\bc[^d]'"); +re = /abc/; +ok(re === RegExp(re), "re !== RegExp(re)"); + +re = RegExp("abc[^d]", "g"); +ok(re.source === "abc[^d]", "re.source = '" + re.source + "', expected 'abc[^d]'"); + +re = /abc/; +ok(re === RegExp(re, undefined), "re !== RegExp(re, undefined)"); + +re = /abc/; +ok(re === RegExp(re, undefined, 1), "re !== RegExp(re, undefined, 1)"); + reportSuccess(); Modified: trunk/rostests/winetests/jscript/run.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/run.c?r…
============================================================================== --- trunk/rostests/winetests/jscript/run.c [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/run.c [iso-8859-1] Mon Oct 19 19:03:40 2009 @@ -65,6 +65,9 @@ DEFINE_EXPECT(global_success_i); DEFINE_EXPECT(global_notexists_d); DEFINE_EXPECT(testobj_delete); +DEFINE_EXPECT(testobj_value); +DEFINE_EXPECT(testobj_prop_d); +DEFINE_EXPECT(testobj_noprop_d); DEFINE_EXPECT(GetItemInfo_testVal); #define DISPID_GLOBAL_TESTPROPGET 0x1000 @@ -75,6 +78,11 @@ #define DISPID_GLOBAL_GETVT 0x1005 #define DISPID_GLOBAL_TESTOBJ 0x1006 #define DISPID_GLOBAL_NULL_BSTR 0x1007 +#define DISPID_GLOBAL_NULL_DISP 0x1008 +#define DISPID_GLOBAL_TESTTHIS 0x1009 +#define DISPID_GLOBAL_TESTTHIS2 0x100a + +#define DISPID_TESTOBJ_PROP 0x2000 static const WCHAR testW[] = {'t','e','s','t',0}; static const CHAR testA[] = "test"; @@ -83,6 +91,7 @@ static BOOL strict_dispid_check; static const char *test_name = "(null)"; +static IDispatch *script_disp; static BSTR a2bstr(const char *str) { @@ -192,17 +201,48 @@ return E_NOTIMPL; } -static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) -{ - ok(0, "unexpected call\n"); - return E_NOTIMPL; -} - -static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, +static HRESULT WINAPI testObj_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + if(!strcmp_wa(bstrName, "prop")) { + CHECK_EXPECT(testobj_prop_d); + ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + *pid = DISPID_TESTOBJ_PROP; + return S_OK; + } + if(!strcmp_wa(bstrName, "noprop")) { + CHECK_EXPECT(testobj_noprop_d); + ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + return DISP_E_UNKNOWNNAME; + } + + ok(0, "unexpected name %s\n", wine_dbgstr_w(bstrName)); + return E_NOTIMPL; +} + +static HRESULT WINAPI testObj_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { - ok(0, "unexpected call\n"); - return E_NOTIMPL; + switch(id) { + case DISPID_VALUE: + CHECK_EXPECT(testobj_value); + + ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(!pdp->rgvarg, "rgvarg != NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pvarRes != NULL, "pvarRes == NULL\n"); + ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes)); + ok(pei != NULL, "pei == NULL\n"); + + V_VT(pvarRes) = VT_I4; + V_I4(pvarRes) = 1; + return S_OK; + } + + ok(0, "unexpected call %x\n", id); + return DISP_E_MEMBERNOTFOUND; } static HRESULT WINAPI testObj_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) @@ -222,8 +262,8 @@ DispatchEx_GetTypeInfo, DispatchEx_GetIDsOfNames, DispatchEx_Invoke, - DispatchEx_GetDispID, - DispatchEx_InvokeEx, + testObj_GetDispID, + testObj_InvokeEx, testObj_DeleteMemberByName, DispatchEx_DeleteMemberByDispID, DispatchEx_GetMemberProperties, @@ -278,10 +318,26 @@ *pid = DISPID_GLOBAL_NULL_BSTR; return S_OK; } + if(!strcmp_wa(bstrName, "nullDisp")) { + *pid = DISPID_GLOBAL_NULL_DISP; + return S_OK; + } if(!strcmp_wa(bstrName, "notExists")) { CHECK_EXPECT(global_notexists_d); ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); return DISP_E_UNKNOWNNAME; + } + + if(!strcmp_wa(bstrName, "testThis")) { + ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + *pid = DISPID_GLOBAL_TESTTHIS; + return S_OK; + } + + if(!strcmp_wa(bstrName, "testThis2")) { + ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + *pid = DISPID_GLOBAL_TESTTHIS2; + return S_OK; } if(strict_dispid_check) @@ -436,6 +492,50 @@ V_BSTR(pvarRes) = NULL; } return S_OK; + + case DISPID_GLOBAL_NULL_DISP: + ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(!pdp->rgvarg, "rgvarg != NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pvarRes != NULL, "pvarRes == NULL\n"); + ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes)); + ok(pei != NULL, "pei == NULL\n"); + + V_VT(pvarRes) = VT_DISPATCH; + V_DISPATCH(pvarRes) = NULL; + return S_OK; + + case DISPID_GLOBAL_TESTTHIS: + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pvarRes == NULL, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(arg) = %d\n", V_VT(pdp->rgvarg)); + ok(V_DISPATCH(pdp->rgvarg) == (IDispatch*)iface, "disp != iface\n"); + + return S_OK; + + case DISPID_GLOBAL_TESTTHIS2: + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pvarRes == NULL, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(arg) = %d\n", V_VT(pdp->rgvarg)); + ok(V_DISPATCH(pdp->rgvarg) != (IDispatch*)iface, "disp == iface\n"); + ok(V_DISPATCH(pdp->rgvarg) == script_disp, "disp != script_disp\n"); + + return S_OK; } ok(0, "unexpected call %x\n", id); @@ -569,7 +669,7 @@ return script; } -static void parse_script(BSTR script_str) +static void parse_script(DWORD flags, BSTR script_str) { IActiveScriptParse *parser; IActiveScript *engine; @@ -594,15 +694,21 @@ ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); hres = IActiveScript_AddNamedItem(engine, testW, - SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); + SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags); ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp); + ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres); + ok(script_disp != NULL, "script_disp == NULL\n"); + ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n"); + hres = IActiveScriptParse64_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + IDispatch_Release(script_disp); IActiveScript_Release(engine); IUnknown_Release(parser); } @@ -648,11 +754,16 @@ return hres; } +static void parse_script_af(DWORD flags, const char *src) +{ + BSTR tmp = a2bstr(src); + parse_script(flags, tmp); + SysFreeString(tmp); +} + static void parse_script_a(const char *src) { - BSTR tmp = a2bstr(src); - parse_script(tmp); - SysFreeString(tmp); + parse_script_af(SCRIPTITEM_GLOBALMEMBERS, src); } static HRESULT parse_htmlscript_a(const char *src) @@ -710,7 +821,7 @@ strict_dispid_check = FALSE; if(script_str) - parse_script(script_str); + parse_script(SCRIPTITEM_GLOBALMEMBERS, script_str); SysFreeString(script_str); } @@ -737,7 +848,7 @@ SET_EXPECT(global_success_d); SET_EXPECT(global_success_i); - parse_script(str); + parse_script(SCRIPTITEM_GLOBALMEMBERS, str); CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i); @@ -842,12 +953,48 @@ parse_script_a("function f() { var testPropGet; }"); + parse_script_a("ok((testObj instanceof Object) === false, 'testObj is instance of Object');"); + + SET_EXPECT(testobj_prop_d); + parse_script_a("ok(('prop' in testObj) === true, 'prop is not in testObj');"); + CHECK_CALLED(testobj_prop_d); + + SET_EXPECT(testobj_noprop_d); + parse_script_a("ok(('noprop' in testObj) === false, 'noprop is in testObj');"); + CHECK_CALLED(testobj_noprop_d); + + SET_EXPECT(testobj_value); + parse_script_a("ok(String(testObj) === '1', 'wrong testObj value');"); + CHECK_CALLED(testobj_value); + + SET_EXPECT(testobj_value); + parse_script_a("ok(String.prototype.concat.call(testObj, ' OK') === '1 OK', 'wrong concat result');"); + CHECK_CALLED(testobj_value); + + SET_EXPECT(global_propget_d); + SET_EXPECT(global_propget_i); + parse_script_a("this.testPropGet;"); + CHECK_CALLED(global_propget_d); + CHECK_CALLED(global_propget_i); + + SET_EXPECT(global_propget_d); + SET_EXPECT(global_propget_i); + parse_script_a("(function () { this.testPropGet; })();"); + CHECK_CALLED(global_propget_d); + CHECK_CALLED(global_propget_i); + + parse_script_a("testThis(this);"); + parse_script_a("(function () { testThis(this); })();"); + run_from_res("lang.js"); run_from_res("api.js"); run_from_res("regexp.js"); test_isvisible(FALSE); test_isvisible(TRUE); + + parse_script_af(0, "test.testThis2(this);"); + parse_script_af(0, "(function () { test.testThis2(this); })();"); hres = parse_htmlscript_a("<!--"); ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
15 years, 2 months
1
0
0
0
[cwittich] 43607: -sync jscript with wine 1.1.31
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Oct 19 19:03:21 2009 New Revision: 43607 URL:
http://svn.reactos.org/svn/reactos?rev=43607&view=rev
Log: -sync jscript with wine 1.1.31 Added: trunk/reactos/dll/win32/jscript/activex.c (with props) Modified: trunk/reactos/dll/win32/jscript/array.c trunk/reactos/dll/win32/jscript/bool.c trunk/reactos/dll/win32/jscript/date.c trunk/reactos/dll/win32/jscript/dispex.c trunk/reactos/dll/win32/jscript/engine.c trunk/reactos/dll/win32/jscript/engine.h trunk/reactos/dll/win32/jscript/error.c trunk/reactos/dll/win32/jscript/function.c trunk/reactos/dll/win32/jscript/global.c trunk/reactos/dll/win32/jscript/jscript.c trunk/reactos/dll/win32/jscript/jscript.h trunk/reactos/dll/win32/jscript/jscript.rbuild trunk/reactos/dll/win32/jscript/jscript_De.rc trunk/reactos/dll/win32/jscript/jscript_En.rc trunk/reactos/dll/win32/jscript/jscript_Fr.rc trunk/reactos/dll/win32/jscript/jscript_Lt.rc trunk/reactos/dll/win32/jscript/jscript_Nl.rc trunk/reactos/dll/win32/jscript/jscript_main.c trunk/reactos/dll/win32/jscript/jsutils.c trunk/reactos/dll/win32/jscript/lex.c trunk/reactos/dll/win32/jscript/math.c trunk/reactos/dll/win32/jscript/number.c trunk/reactos/dll/win32/jscript/object.c trunk/reactos/dll/win32/jscript/parser.tab.c trunk/reactos/dll/win32/jscript/parser.tab.h trunk/reactos/dll/win32/jscript/parser.y trunk/reactos/dll/win32/jscript/regexp.c trunk/reactos/dll/win32/jscript/resource.h trunk/reactos/dll/win32/jscript/string.c trunk/reactos/include/psdk/activdbg.idl trunk/reactos/include/psdk/urlmon.idl [This mail would be too long, it was shortened to contain the URLs only.] Added: trunk/reactos/dll/win32/jscript/activex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/activex.…
Modified: trunk/reactos/dll/win32/jscript/array.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/array.c?…
Modified: trunk/reactos/dll/win32/jscript/bool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/bool.c?r…
Modified: trunk/reactos/dll/win32/jscript/date.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/date.c?r…
Modified: trunk/reactos/dll/win32/jscript/dispex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/dispex.c…
Modified: trunk/reactos/dll/win32/jscript/engine.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/engine.c…
Modified: trunk/reactos/dll/win32/jscript/engine.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/engine.h…
Modified: trunk/reactos/dll/win32/jscript/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/error.c?…
Modified: trunk/reactos/dll/win32/jscript/function.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/function…
Modified: trunk/reactos/dll/win32/jscript/global.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/global.c…
Modified: trunk/reactos/dll/win32/jscript/jscript.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Modified: trunk/reactos/dll/win32/jscript/jscript.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Modified: trunk/reactos/dll/win32/jscript/jscript.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
Modified: trunk/reactos/dll/win32/jscript/jscript_De.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jscript_En.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jscript_Fr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jscript_Lt.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jscript_Nl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jscript_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript_…
Modified: trunk/reactos/dll/win32/jscript/jsutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsutils.…
Modified: trunk/reactos/dll/win32/jscript/lex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/lex.c?re…
Modified: trunk/reactos/dll/win32/jscript/math.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/math.c?r…
Modified: trunk/reactos/dll/win32/jscript/number.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/number.c…
Modified: trunk/reactos/dll/win32/jscript/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/object.c…
Modified: trunk/reactos/dll/win32/jscript/parser.tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.t…
Modified: trunk/reactos/dll/win32/jscript/parser.tab.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.t…
Modified: trunk/reactos/dll/win32/jscript/parser.y URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.y…
Modified: trunk/reactos/dll/win32/jscript/regexp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/regexp.c…
Modified: trunk/reactos/dll/win32/jscript/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/resource…
Modified: trunk/reactos/dll/win32/jscript/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/string.c…
Modified: trunk/reactos/include/psdk/activdbg.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/activdbg.idl?…
Modified: trunk/reactos/include/psdk/urlmon.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/urlmon.idl?re…
15 years, 2 months
1
0
0
0
[fireball] 43606: [ntoskrnl/lpc] - Mark NtRequestPort/NtReplyPort as implemented.
by fireball@svn.reactos.org
Author: fireball Date: Mon Oct 19 18:37:12 2009 New Revision: 43606 URL:
http://svn.reactos.org/svn/reactos?rev=43606&view=rev
Log: [ntoskrnl/lpc] - Mark NtRequestPort/NtReplyPort as implemented. Modified: trunk/reactos/ntoskrnl/lpc/reply.c trunk/reactos/ntoskrnl/lpc/send.c Modified: trunk/reactos/ntoskrnl/lpc/reply.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/reply.c?rev=4…
============================================================================== --- trunk/reactos/ntoskrnl/lpc/reply.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/lpc/reply.c [iso-8859-1] Mon Oct 19 18:37:12 2009 @@ -136,7 +136,7 @@ /* PUBLIC FUNCTIONS **********************************************************/ /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI Modified: trunk/reactos/ntoskrnl/lpc/send.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/send.c?rev=43…
============================================================================== --- trunk/reactos/ntoskrnl/lpc/send.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/lpc/send.c [iso-8859-1] Mon Oct 19 18:37:12 2009 @@ -437,7 +437,7 @@ } /* - * @unimplemented + * @implemented */ NTSTATUS NTAPI
15 years, 2 months
1
0
0
0
[tkreuzer] 43605: [FREELDR] - include the intrinsics from the kernel - set segement selectors
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Oct 19 18:19:29 2009 New Revision: 43605 URL:
http://svn.reactos.org/svn/reactos?rev=43605&view=rev
Log: [FREELDR] - include the intrinsics from the kernel - set segement selectors Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h [iso-8859-1] Mon Oct 19 18:19:29 2009 @@ -58,13 +58,6 @@ HARDWARE_PTE Pde[512]; } PAGE_DIRECTORY_AMD64, *PPAGE_DIRECTORY_AMD64; -VOID -FORCEINLINE -__lgdt(void *gdt) -{ - asm volatile ("lgdt %0\n" : : "m"(*(short*)gdt)); -} - PKGDTENTRY64 FORCEINLINE KiGetGdtEntry(PVOID pGdt, USHORT Index) Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Mon Oct 19 18:19:29 2009 @@ -86,6 +86,7 @@ #elif defined(_M_AMD64) #include <arch/amd64/hardware.h> #include <arch/amd64/machpc.h> +#include <internal/amd64/intrin_i.h> #endif /* misc files */ #include <keycodes.h> Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c [iso-8859-1] Mon Oct 19 18:19:29 2009 @@ -341,8 +341,20 @@ WinLdrSetupIdt((PVOID)((ULONG64)GdtIdt + 2048)); // HACK! + /* LDT is unused */ + __lldt(0); + + /* Load selectors for DS/ES/FS/GS/SS */ + Ke386SetDs(KGDT_64_DATA | RPL_MASK); // 0x2b + Ke386SetEs(KGDT_64_DATA | RPL_MASK); // 0x2b + Ke386SetFs(KGDT_32_R3_TEB | RPL_MASK); // 0x53 + Ke386SetGs(KGDT_64_DATA | RPL_MASK); // 0x2b + Ke386SetSs(KGDT_64_R0_SS); // 0x18 + + // Load TSR + Ke386SetTr(KGDT_TSS); + DPRINTM(DPRINT_WINDOWS, "leave WinLdrSetProcessorContext\n"); - } VOID
15 years, 2 months
1
0
0
0
[tkreuzer] 43604: [FREELDR] - Add MempIsPageMapped for debugging puposes - Map pages for kernel, too in MempSetupPaging Now we reach the kernel's entry point again.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Oct 19 17:51:57 2009 New Revision: 43604 URL:
http://svn.reactos.org/svn/reactos?rev=43604&view=rev
Log: [FREELDR] - Add MempIsPageMapped for debugging puposes - Map pages for kernel, too in MempSetupPaging Now we reach the kernel's entry point again. Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c [iso-8859-1] Mon Oct 19 17:51:57 2009 @@ -125,6 +125,35 @@ return TRUE; } +BOOLEAN +MempIsPageMapped(PVOID VirtualAddress) +{ + PPAGE_DIRECTORY_AMD64 pDir; + ULONG Index; + + pDir = pPML4; + Index = VAtoPXI(VirtualAddress); + if (!pDir->Pde[Index].Valid) + return FALSE; + + pDir = (PPAGE_DIRECTORY_AMD64)((ULONG64)(pDir->Pde[Index].PageFrameNumber) * PAGE_SIZE); + Index = VAtoPPI(VirtualAddress); + if (!pDir->Pde[Index].Valid) + return FALSE; + + pDir = (PPAGE_DIRECTORY_AMD64)((ULONG64)(pDir->Pde[Index].PageFrameNumber) * PAGE_SIZE); + Index = VAtoPDI(VirtualAddress); + if (!pDir->Pde[Index].Valid) + return FALSE; + + pDir = (PPAGE_DIRECTORY_AMD64)((ULONG64)(pDir->Pde[Index].PageFrameNumber) * PAGE_SIZE); + Index = VAtoPTI(VirtualAddress); + if (!pDir->Pde[Index].Valid) + return FALSE; + + return TRUE; +} + ULONG MempMapRangeOfPages(ULONGLONG VirtualAddress, ULONGLONG PhysicalAddress, ULONG cPages) { @@ -146,13 +175,24 @@ MempSetupPaging(IN ULONG StartPage, IN ULONG NumberOfPages) { - DPRINTM(DPRINT_WINDOWS,">>> MempSetupPaging(0x%lx, %ld)\n", StartPage, NumberOfPages); - + DPRINTM(DPRINT_WINDOWS,">>> MempSetupPaging(0x%lx, %ld, %p)\n", + StartPage, NumberOfPages, StartPage * PAGE_SIZE + KSEG0_BASE); + + /* Identity mapping */ if (MempMapRangeOfPages(StartPage * PAGE_SIZE, StartPage * PAGE_SIZE, NumberOfPages) != NumberOfPages) { - DPRINTM(DPRINT_WINDOWS,"Failed to map pages\n"); + DPRINTM(DPRINT_WINDOWS,"Failed to map pages 1\n"); + return FALSE; + } + + /* Kernel mapping */ + if (MempMapRangeOfPages(StartPage * PAGE_SIZE + KSEG0_BASE, + StartPage * PAGE_SIZE, + NumberOfPages) != NumberOfPages) + { + DPRINTM(DPRINT_WINDOWS,"Failed to map pages 2\n"); return FALSE; }
15 years, 2 months
1
0
0
0
[fireball] 43603: [ntoskrnl/lpc] - Implement NtReplyPort based on NtReplyWaitReceivePortEx and LpcReplyPort. - Implement NtRequestPort based on NtRequestWaitReplyPort and LpcRequestPort.
by fireball@svn.reactos.org
Author: fireball Date: Mon Oct 19 17:49:29 2009 New Revision: 43603 URL:
http://svn.reactos.org/svn/reactos?rev=43603&view=rev
Log: [ntoskrnl/lpc] - Implement NtReplyPort based on NtReplyWaitReceivePortEx and LpcReplyPort. - Implement NtRequestPort based on NtRequestWaitReplyPort and LpcRequestPort. Modified: trunk/reactos/ntoskrnl/lpc/reply.c trunk/reactos/ntoskrnl/lpc/send.c Modified: trunk/reactos/ntoskrnl/lpc/reply.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/reply.c?rev=4…
============================================================================== --- trunk/reactos/ntoskrnl/lpc/reply.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/lpc/reply.c [iso-8859-1] Mon Oct 19 17:49:29 2009 @@ -141,10 +141,172 @@ NTSTATUS NTAPI NtReplyPort(IN HANDLE PortHandle, - IN PPORT_MESSAGE LpcReply) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + IN PPORT_MESSAGE ReplyMessage) +{ + PLPCP_PORT_OBJECT Port, ConnectionPort = NULL; + KPROCESSOR_MODE PreviousMode = KeGetPreviousMode(); + NTSTATUS Status; + PLPCP_MESSAGE Message; + PETHREAD Thread = PsGetCurrentThread(), WakeupThread; + //PORT_MESSAGE CapturedReplyMessage; + + PAGED_CODE(); + LPCTRACE(LPC_REPLY_DEBUG, + "Handle: %lx. Message: %p.\n", + PortHandle, + ReplyMessage); + + if (KeGetPreviousMode() == UserMode) + { + _SEH2_TRY + { + if (ReplyMessage != NULL) + { + ProbeForRead(ReplyMessage, sizeof(PORT_MESSAGE), sizeof(ULONG)); + /*RtlCopyMemory(&CapturedReplyMessage, ReplyMessage, sizeof(PORT_MESSAGE)); + ReplyMessage = &CapturedReplyMessage;*/ + } + } + _SEH2_EXCEPT(ExSystemExceptionFilter()) + { + DPRINT1("SEH crash [1]\n"); + DbgBreakPoint(); + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + } + + /* Validate its length */ + if (((ULONG)ReplyMessage->u1.s1.DataLength + sizeof(PORT_MESSAGE)) > + (ULONG)ReplyMessage->u1.s1.TotalLength) + { + /* Fail */ + return STATUS_INVALID_PARAMETER; + } + + /* Make sure it has a valid ID */ + if (!ReplyMessage->MessageId) return STATUS_INVALID_PARAMETER; + + /* Get the Port object */ + Status = ObReferenceObjectByHandle(PortHandle, + 0, + LpcPortObjectType, + PreviousMode, + (PVOID*)&Port, + NULL); + if (!NT_SUCCESS(Status)) return Status; + + /* Validate its length in respect to the port object */ + if (((ULONG)ReplyMessage->u1.s1.TotalLength > Port->MaxMessageLength) || + ((ULONG)ReplyMessage->u1.s1.TotalLength <= + (ULONG)ReplyMessage->u1.s1.DataLength)) + { + /* Too large, fail */ + ObDereferenceObject(Port); + return STATUS_PORT_MESSAGE_TOO_LONG; + } + + /* Get the ETHREAD corresponding to it */ + Status = PsLookupProcessThreadByCid(&ReplyMessage->ClientId, + NULL, + &WakeupThread); + if (!NT_SUCCESS(Status)) + { + /* No thread found, fail */ + ObDereferenceObject(Port); + if (ConnectionPort) ObDereferenceObject(ConnectionPort); + return Status; + } + + /* Allocate a message from the port zone */ + Message = LpcpAllocateFromPortZone(); + if (!Message) + { + /* Fail if we couldn't allocate a message */ + if (ConnectionPort) ObDereferenceObject(ConnectionPort); + ObDereferenceObject(WakeupThread); + ObDereferenceObject(Port); + return STATUS_NO_MEMORY; + } + + /* Keep the lock acquired */ + KeAcquireGuardedMutex(&LpcpLock); + + /* Make sure this is the reply the thread is waiting for */ + if ((WakeupThread->LpcReplyMessageId != ReplyMessage->MessageId) || + ((LpcpGetMessageFromThread(WakeupThread)) && + (LpcpGetMessageType(&LpcpGetMessageFromThread(WakeupThread)-> + Request) != LPC_REQUEST))) + { + /* It isn't, fail */ + LpcpFreeToPortZone(Message, 3); + if (ConnectionPort) ObDereferenceObject(ConnectionPort); + ObDereferenceObject(WakeupThread); + ObDereferenceObject(Port); + return STATUS_REPLY_MESSAGE_MISMATCH; + } + + /* Copy the message */ + _SEH2_TRY + { + LpcpMoveMessage(&Message->Request, + ReplyMessage, + ReplyMessage + 1, + LPC_REPLY, + NULL); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Fail */ + LpcpFreeToPortZone(Message, 3); + ObDereferenceObject(WakeupThread); + ObDereferenceObject(Port); + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + + /* Reference the thread while we use it */ + ObReferenceObject(WakeupThread); + Message->RepliedToThread = WakeupThread; + + /* Set this as the reply message */ + WakeupThread->LpcReplyMessageId = 0; + WakeupThread->LpcReplyMessage = (PVOID)Message; + + /* Check if we have messages on the reply chain */ + if (!(WakeupThread->LpcExitThreadCalled) && + !(IsListEmpty(&WakeupThread->LpcReplyChain))) + { + /* Remove us from it and reinitialize it */ + RemoveEntryList(&WakeupThread->LpcReplyChain); + InitializeListHead(&WakeupThread->LpcReplyChain); + } + + /* Check if this is the message the thread had received */ + if ((Thread->LpcReceivedMsgIdValid) && + (Thread->LpcReceivedMessageId == ReplyMessage->MessageId)) + { + /* Clear this data */ + Thread->LpcReceivedMessageId = 0; + Thread->LpcReceivedMsgIdValid = FALSE; + } + + /* Free any data information */ + LpcpFreeDataInfoMessage(Port, + ReplyMessage->MessageId, + ReplyMessage->CallbackId, + ReplyMessage->ClientId); + + /* Release the lock and release the LPC semaphore to wake up waiters */ + KeReleaseGuardedMutex(&LpcpLock); + LpcpCompleteWait(&WakeupThread->LpcReplySemaphore); + + /* Now we can let go of the thread */ + ObDereferenceObject(WakeupThread); + + /* Dereference port object */ + ObDereferenceObject(Port); + return Status; } /* Modified: trunk/reactos/ntoskrnl/lpc/send.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/send.c?rev=43…
============================================================================== --- trunk/reactos/ntoskrnl/lpc/send.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/lpc/send.c [iso-8859-1] Mon Oct 19 17:49:29 2009 @@ -442,10 +442,195 @@ NTSTATUS NTAPI NtRequestPort(IN HANDLE PortHandle, - IN PPORT_MESSAGE LpcMessage) + IN PPORT_MESSAGE LpcRequest) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + PLPCP_PORT_OBJECT Port, QueuePort, ConnectionPort = NULL; + KPROCESSOR_MODE PreviousMode = KeGetPreviousMode(); + NTSTATUS Status; + PLPCP_MESSAGE Message; + PETHREAD Thread = PsGetCurrentThread(); + + PKSEMAPHORE Semaphore; + ULONG MessageType; + PAGED_CODE(); + LPCTRACE(LPC_SEND_DEBUG, + "Handle: %lx. Message: %p. Type: %lx\n", + PortHandle, + LpcRequest, + LpcpGetMessageType(LpcRequest)); + + /* Get the message type */ + MessageType = LpcRequest->u2.s2.Type | LPC_DATAGRAM; + + /* Can't have data information on this type of call */ + if (LpcRequest->u2.s2.DataInfoOffset) return STATUS_INVALID_PARAMETER; + + /* Validate the length */ + if (((ULONG)LpcRequest->u1.s1.DataLength + sizeof(PORT_MESSAGE)) > + (ULONG)LpcRequest->u1.s1.TotalLength) + { + /* Fail */ + return STATUS_INVALID_PARAMETER; + } + + /* Reference the object */ + Status = ObReferenceObjectByHandle(PortHandle, + 0, + LpcPortObjectType, + PreviousMode, + (PVOID*)&Port, + NULL); + if (!NT_SUCCESS(Status)) return Status; + + /* Validate the message length */ + if (((ULONG)LpcRequest->u1.s1.TotalLength > Port->MaxMessageLength) || + ((ULONG)LpcRequest->u1.s1.TotalLength <= (ULONG)LpcRequest->u1.s1.DataLength)) + { + /* Fail */ + ObDereferenceObject(Port); + return STATUS_PORT_MESSAGE_TOO_LONG; + } + + /* Allocate a message from the port zone */ + Message = LpcpAllocateFromPortZone(); + if (!Message) + { + /* Fail if we couldn't allocate a message */ + ObDereferenceObject(Port); + return STATUS_NO_MEMORY; + } + + /* No callback, just copy the message */ + _SEH2_TRY + { + /* Copy it */ + LpcpMoveMessage(&Message->Request, + LpcRequest, + LpcRequest + 1, + MessageType, + &Thread->Cid); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Fail */ + LpcpFreeToPortZone(Message, 0); + ObDereferenceObject(Port); + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + + /* Acquire the LPC lock */ + KeAcquireGuardedMutex(&LpcpLock); + + /* Right now clear the port context */ + Message->PortContext = NULL; + + /* Check if this is a not connection port */ + if ((Port->Flags & LPCP_PORT_TYPE_MASK) != LPCP_CONNECTION_PORT) + { + /* We want the connected port */ + QueuePort = Port->ConnectedPort; + if (!QueuePort) + { + /* We have no connected port, fail */ + LpcpFreeToPortZone(Message, 3); + ObDereferenceObject(Port); + return STATUS_PORT_DISCONNECTED; + } + + /* Check if this is a communication port */ + if ((Port->Flags & LPCP_PORT_TYPE_MASK) == LPCP_CLIENT_PORT) + { + /* Copy the port context and use the connection port */ + Message->PortContext = QueuePort->PortContext; + ConnectionPort = QueuePort = Port->ConnectionPort; + if (!ConnectionPort) + { + /* Fail */ + LpcpFreeToPortZone(Message, 3); + ObDereferenceObject(Port); + return STATUS_PORT_DISCONNECTED; + } + } + else if ((Port->Flags & LPCP_PORT_TYPE_MASK) != + LPCP_COMMUNICATION_PORT) + { + /* Use the connection port for anything but communication ports */ + ConnectionPort = QueuePort = Port->ConnectionPort; + if (!ConnectionPort) + { + /* Fail */ + LpcpFreeToPortZone(Message, 3); + ObDereferenceObject(Port); + return STATUS_PORT_DISCONNECTED; + } + } + + /* Reference the connection port if it exists */ + if (ConnectionPort) ObReferenceObject(ConnectionPort); + } + else + { + /* Otherwise, for a connection port, use the same port object */ + QueuePort = Port; + } + + /* Reference QueuePort if we have it */ + if (QueuePort && ObReferenceObjectSafe(QueuePort)) + { + /* Set sender's port */ + Message->SenderPort = Port; + + /* Generate the Message ID and set it */ + Message->Request.MessageId = LpcpNextMessageId++; + if (!LpcpNextMessageId) LpcpNextMessageId = 1; + Message->Request.CallbackId = 0; + + /* No Message ID for the thread */ + PsGetCurrentThread()->LpcReplyMessageId = 0; + + /* Insert the message in our chain */ + InsertTailList(&QueuePort->MsgQueue.ReceiveHead, &Message->Entry); + + /* Release the lock and get the semaphore we'll use later */ + KeEnterCriticalRegion(); + KeReleaseGuardedMutex(&LpcpLock); + + /* Now release the semaphore */ + Semaphore = QueuePort->MsgQueue.Semaphore; + LpcpCompleteWait(Semaphore); + + /* If this is a waitable port, wake it up */ + if (QueuePort->Flags & LPCP_WAITABLE_PORT) + { + /* Wake it */ + KeSetEvent(&QueuePort->WaitEvent, IO_NO_INCREMENT, FALSE); + } + + KeLeaveCriticalRegion(); + + /* Dereference objects */ + if (ConnectionPort) ObDereferenceObject(ConnectionPort); + ObDereferenceObject(QueuePort); + ObDereferenceObject(Port); + LPCTRACE(LPC_SEND_DEBUG, "Port: %p. Message: %p\n", QueuePort, Message); + return STATUS_SUCCESS; + } + + Status = STATUS_PORT_DISCONNECTED; + + /* All done with a failure*/ + LPCTRACE(LPC_SEND_DEBUG, + "Port: %p. Status: %p\n", + Port, + Status); + + /* The wait failed, free the message */ + if (Message) LpcpFreeToPortZone(Message, 3); + + ObDereferenceObject(Port); + if (ConnectionPort) ObDereferenceObject(ConnectionPort); + return Status; } /*
15 years, 2 months
1
0
0
0
[tkreuzer] 43602: [FREELDR] Round up to pages when updating LoaderPagesSpanned to avoid a bug when the last memory region is not mapped.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Oct 19 17:39:16 2009 New Revision: 43602 URL:
http://svn.reactos.org/svn/reactos?rev=43602&view=rev
Log: [FREELDR] Round up to pages when updating LoaderPagesSpanned to avoid a bug when the last memory region is not mapped. Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Mon Oct 19 17:39:16 2009 @@ -75,8 +75,8 @@ #endif // DBG // Update LoaderPagesSpanned count - if ((((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT) > LoaderPagesSpanned) - LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT); + if ((((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT) > LoaderPagesSpanned) + LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT); // Now return the pointer return MemPointer; @@ -175,8 +175,8 @@ #endif // DBG // Update LoaderPagesSpanned count - if ((((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT) > LoaderPagesSpanned) - LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT); + if ((((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT) > LoaderPagesSpanned) + LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT); // Now return the pointer return MemPointer;
15 years, 2 months
1
0
0
0
[tkreuzer] 43601: [FREELDR] - Move definition of KIP0PCRADDRESS into arch specific header - Implement WinLdrSetupForNt for amd64 (copied x86 version) - Fix mapping of PCR and KI_USER_SHARED_DATA - Don't enable paging again, it is already enabled on amd64 - Fix WinLdrSetProcessorContext to take a ULONG_PTR not ULONG for Pcr and Tss
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Oct 19 14:50:36 2009 New Revision: 43601 URL:
http://svn.reactos.org/svn/reactos?rev=43601&view=rev
Log: [FREELDR] - Move definition of KIP0PCRADDRESS into arch specific header - Implement WinLdrSetupForNt for amd64 (copied x86 version) - Fix mapping of PCR and KI_USER_SHARED_DATA - Don't enable paging again, it is already enabled on amd64 - Fix WinLdrSetProcessorContext to take a ULONG_PTR not ULONG for Pcr and Tss Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/i386/i386.h branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/ntsetup.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/wlmemory.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h [iso-8859-1] Mon Oct 19 14:50:36 2009 @@ -20,6 +20,10 @@ #ifndef __AMD64_AMD64_H_ #define __AMD64_AMD64_H_ + +// This is needed because headers define wrong one for ReactOS +#undef KIP0PCRADDRESS +#define KIP0PCRADDRESS 0xFFFFF78000001000ULL /* FIXME!!! */ #define STACK64ADDR 0x74000 /* The 64-bit stack top will be at 0x74000 */ Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/i386/i386.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/i386/i386.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/i386/i386.h [iso-8859-1] Mon Oct 19 14:50:36 2009 @@ -21,6 +21,9 @@ #ifndef __I386_I386_H_ #define __I386_I386_H_ +// This is needed because headers define wrong one for ReactOS +#undef KIP0PCRADDRESS +#define KIP0PCRADDRESS 0xffdff000 #endif /* __I386_I386_H_ */ Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/ntsetup.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/ntsetup.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/ntsetup.c [iso-8859-1] Mon Oct 19 14:50:36 2009 @@ -40,5 +40,45 @@ ULONG *PcrBasePage, ULONG *TssBasePage) { + ULONG TssSize; + ULONG TssPages; + ULONG_PTR Pcr = 0; + ULONG_PTR Tss = 0; + ULONG BlockSize, NumPages; + LoaderBlock->u.I386.CommonDataArea = NULL; // Force No ABIOS support + LoaderBlock->u.I386.MachineType = MACHINE_TYPE_ISA; + + /* Allocate 2 pages for PCR */ + Pcr = (ULONG_PTR)MmAllocateMemoryWithType(2 * MM_PAGE_SIZE, LoaderStartupPcrPage); + *PcrBasePage = Pcr >> MM_PAGE_SHIFT; + RtlZeroMemory((PVOID)Pcr, 2 * MM_PAGE_SIZE); + + if (Pcr == 0) + { + UiMessageBox("Can't allocate PCR\n"); + return; + } + + /* Allocate TSS */ + TssSize = (sizeof(KTSS) + MM_PAGE_SIZE) & ~(MM_PAGE_SIZE - 1); + TssPages = TssSize / MM_PAGE_SIZE; + + Tss = (ULONG_PTR)MmAllocateMemoryWithType(TssSize, LoaderMemoryData); + + *TssBasePage = Tss >> MM_PAGE_SHIFT; + + /* Allocate space for new GDT + IDT */ + BlockSize = NUM_GDT*sizeof(KGDTENTRY) + NUM_IDT*sizeof(KIDTENTRY);//FIXME: Use GDT/IDT limits here? + NumPages = (BlockSize + MM_PAGE_SIZE - 1) >> MM_PAGE_SHIFT; + *GdtIdt = (PKGDTENTRY)MmAllocateMemoryWithType(NumPages * MM_PAGE_SIZE, LoaderMemoryData); + + if (*GdtIdt == NULL) + { + UiMessageBox("Can't allocate pages for GDT+IDT!\n"); + return; + } + + /* Zero newly prepared GDT+IDT */ + RtlZeroMemory(*GdtIdt, NumPages << MM_PAGE_SHIFT); } Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c [iso-8859-1] Mon Oct 19 14:50:36 2009 @@ -15,10 +15,6 @@ //extern ULONG LoaderPagesSpanned; -// This is needed because headers define wrong one for ReactOS -#undef KIP0PCRADDRESS -#define KIP0PCRADDRESS 0xffdff000 - #define HYPER_SPACE_ENTRY 0x300 // This is needed only for SetProcessorContext routine @@ -100,7 +96,7 @@ } BOOLEAN -MempMapSinglePage(ULONGLONG VirtualAddress, ULONGLONG PhysicalAddress) +MempMapSinglePage(ULONG64 VirtualAddress, ULONG64 PhysicalAddress) { PPAGE_DIRECTORY_AMD64 pDir3, pDir2, pDir1; ULONG Index; @@ -110,11 +106,15 @@ pDir1 = MempGetOrCreatePageDir(pDir2, VAtoPDI(VirtualAddress)); if (!pDir1) + { + DPRINTM(DPRINT_WINDOWS,"!!!No Dir %p, %p, %p, %p\n", pPML4, pDir3, pDir2, pDir1); return FALSE; + } Index = VAtoPTI(VirtualAddress); if (pDir1->Pde[Index].Valid) { + DPRINTM(DPRINT_WINDOWS,"!!!Already mapped %ld\n", Index); return FALSE; } @@ -201,14 +201,14 @@ WinLdrMapSpecialPages(ULONG PcrBasePage) { /* Map the PCR page */ - if (!MempMapSinglePage(PcrBasePage * PAGE_SIZE, KIP0PCRADDRESS)) + if (!MempMapSinglePage(KIP0PCRADDRESS, PcrBasePage * PAGE_SIZE)) { DPRINTM(DPRINT_WINDOWS, "Could not map PCR @ %lx\n", PcrBasePage); return FALSE; } /* Map KI_USER_SHARED_DATA */ - if (!MempMapSinglePage((PcrBasePage+1) * PAGE_SIZE, KI_USER_SHARED_DATA)) + if (!MempMapSinglePage(KI_USER_SHARED_DATA, (PcrBasePage+1) * PAGE_SIZE)) { DPRINTM(DPRINT_WINDOWS, "Could not map KI_USER_SHARED_DATA\n"); return FALSE; @@ -284,6 +284,8 @@ VOID WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG64 Pcr, IN ULONG64 Tss) { + DPRINTM(DPRINT_WINDOWS, "WinLdrSetProcessorContext %p\n", Pcr); + /* Disable Interrupts */ _disable(); @@ -293,18 +295,13 @@ /* Set the new PML4 */ __writecr3((ULONGLONG)pPML4); - // Enable paging by modifying CR0 - __writecr0(__readcr0() | CR0_PG); - - // Kernel expects the PCR to be zero-filled on startup - // FIXME: Why zero it here when we can zero it right after allocation? - RtlZeroMemory((PVOID)Pcr, MM_PAGE_SIZE); //FIXME: Why zero only 1 page when we allocate 2? - RtlZeroMemory(GdtIdt, PAGE_SIZE); WinLdrSetupGdt(GdtIdt, Tss); - WinLdrSetupIdt(GdtIdt); + WinLdrSetupIdt((PVOID)((ULONG64)GdtIdt + 2048)); // HACK! + + DPRINTM(DPRINT_WINDOWS, "leave WinLdrSetProcessorContext\n"); } Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] Mon Oct 19 14:50:36 2009 @@ -14,10 +14,6 @@ #include <debug.h> extern ULONG LoaderPagesSpanned; - -// This is needed because headers define wrong one for ReactOS -#undef KIP0PCRADDRESS -#define KIP0PCRADDRESS 0xffdff000 PCHAR MemTypeDesc[] = { "ExceptionBlock ", // ? @@ -63,7 +59,7 @@ WinLdrRemoveDescriptor(IN PMEMORY_ALLOCATION_DESCRIPTOR Descriptor); VOID -WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG Pcr, IN ULONG Tss); +WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG_PTR Pcr, IN ULONG_PTR Tss); BOOLEAN MempAllocatePageTables();
15 years, 2 months
1
0
0
0
[tkreuzer] 43600: Fix a bug :D
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Oct 19 14:36:10 2009 New Revision: 43600 URL:
http://svn.reactos.org/svn/reactos?rev=43600&view=rev
Log: Fix a bug :D Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c [iso-8859-1] Mon Oct 19 14:36:10 2009 @@ -541,7 +541,7 @@ MempDump() { ULONG *PDE_Addr=(ULONG *)PDE;//0xC0300000; - int j; + int i, j; DPRINTM(DPRINT_WINDOWS, "\nPDE\n");
15 years, 2 months
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
65
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Results per page:
10
25
50
100
200