[ros-dev] [ros-diffs] [tkreuzer] 64593: [NTOSKRNL] Modify MiCreatePebOrTeb to use MiInsertVadEx instead of doing everything "by hand". No, this does not "change Windows behavior". The TEB creation works exactly as befor...
Pourquoi Linda Wang ?? :)
Kind regards,
Sylvain Petreolle
________________________________
De : Alex Ionescu <ionucu at videotron.ca>
À : ReactOS Development List <ros-dev at reactos.org>
Cc : Linda Wang <ros-diffs at reactos.org>
Envoyé le : Samedi 11 octobre 2014 18h38
Objet : Re: [ros-dev] [ros-diffs] [tkreuzer] 64593: [NTOSKRNL] Modify MiCreatePebOrTeb to use MiInsertVadEx instead of doing everything "by hand". No, this does not "change Windows behavior". The TEB creation works exactly as befor...
Why do you think PEB creation cannot fail in the first place?
Best regards,
Alex Ionescu
On Tue, Oct 7, 2014 at 5:31 PM, <tkreuzer at svn.reactos.org> wrote:
Author: tkreuzer
>Date: Wed Oct 8 00:31:49 2014
>New Revision: 64593
>>URL: http://svn.reactos.org/svn/reactos?rev=64593&view=rev
>Log:
>[NTOSKRNL]
>Modify MiCreatePebOrTeb to use MiInsertVadEx instead of doing everything "by hand". No, this does not "change Windows behavior". The TEB creation works exactly as before, and the only difference in the PEB creation is that if the first attempt fails, we will no longer try again from the top of the address space. But since this cannot fail in the first place, at least not due to the VA range not being free, another attempt would be pointless anyway!
>>Modified:
> trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
>>Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
>URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c?rev=64593&r1=64592&r2=64593&view=diff
>==============================================================================
>--- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original)
>+++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Wed Oct 8 00:31:49 2014
>@@ -50,14 +50,11 @@
> IN ULONG Size,
> OUT PULONG_PTR BaseAddress)
> {
>- PETHREAD Thread = PsGetCurrentThread();
> PMMVAD_LONG Vad;
> NTSTATUS Status;
> ULONG_PTR HighestAddress, RandomBase;
> ULONG AlignedSize;
> LARGE_INTEGER CurrentTime;
>- TABLE_SEARCH_RESULT Result = TableFoundNode;
>- PMMADDRESS_NODE Parent;
>> /* Allocate a VAD */
> Vad = ExAllocatePoolWithTag(NonPagedPool, sizeof(MMVAD_LONG), 'ldaV');
>@@ -70,6 +67,7 @@
> Vad->u.VadFlags.PrivateMemory = TRUE;
> Vad->u.VadFlags.Protection = MM_READWRITE;
> Vad->u.VadFlags.NoChange = TRUE;
>+ Vad->u1.Parent = NULL;
>> /* Setup the secondary flags to make it a secured, writable, long VAD */
> Vad->u2.LongFlags2 = 0;
>@@ -77,10 +75,11 @@
> Vad->u2.VadFlags2.LongVad = TRUE;
> Vad->u2.VadFlags2.ReadOnly = FALSE;
>>- /* Lock the process address space */
>- KeAcquireGuardedMutex(&Process->AddressCreationLock);
>+ Vad->ControlArea = NULL; // For Memory-Area hack
>+ Vad->FirstPrototypePte = NULL;
>> /* Check if this is a PEB creation */
>+ ASSERT(sizeof(TEB) != sizeof(PEB));
> if (Size == sizeof(PEB))
> {
> /* Create a random value to select one page in a 64k region */
>@@ -100,68 +99,27 @@
>> /* Calculate the highest allowed address */
> HighestAddress = RandomBase + AlignedSize - 1;
>-
>- /* Try to find something below the random upper margin */
>- Result = MiFindEmptyAddressRangeDownTree(ROUND_TO_PAGES(Size),
>- HighestAddress,
>- PAGE_SIZE,
>- &Process->VadRoot,
>- BaseAddress,
>- &Parent);
>- }
>-
>- /* Check for success. TableFoundNode means nothing free. */
>- if (Result == TableFoundNode)
>- {
>- /* For TEBs, or if a PEB location couldn't be found, scan the VAD root */
>- Result = MiFindEmptyAddressRangeDownTree(ROUND_TO_PAGES(Size),
>- (ULONG_PTR)MM_HIGHEST_VAD_ADDRESS,
>- PAGE_SIZE,
>- &Process->VadRoot,
>- BaseAddress,
>- &Parent);
>- /* Bail out, if still nothing free was found */
>- if (Result == TableFoundNode)
>- {
>- KeReleaseGuardedMutex(&Process->AddressCreationLock);
>- ExFreePoolWithTag(Vad, 'ldaV');
>- return STATUS_NO_MEMORY;
>- }
>- }
>-
>- /* Validate that it came from the VAD ranges */
>- ASSERT(*BaseAddress >= (ULONG_PTR)MI_LOWEST_VAD_ADDRESS);
>-
>- /* Build the rest of the VAD now */
>- Vad->StartingVpn = (*BaseAddress) >> PAGE_SHIFT;
>- Vad->EndingVpn = ((*BaseAddress) + Size - 1) >> PAGE_SHIFT;
>- Vad->u3.Secured.StartVpn = *BaseAddress;
>- Vad->u3.Secured.EndVpn = (Vad->EndingVpn << PAGE_SHIFT) | (PAGE_SIZE - 1);
>- Vad->u1.Parent = NULL;
>-
>- /* FIXME: Should setup VAD bitmap */
>- Status = STATUS_SUCCESS;
>-
>- /* Pretend as if we own the working set */
>- MiLockProcessWorkingSetUnsafe(Process, Thread);
>-
>- /* Insert the VAD */
>- ASSERT(Vad->EndingVpn >= Vad->StartingVpn);
>- Process->VadRoot.NodeHint = Vad;
>- Vad->ControlArea = NULL; // For Memory-Area hack
>- Vad->FirstPrototypePte = NULL;
>- DPRINT("VAD: %p\n", Vad);
>- DPRINT("Allocated PEB/TEB at: 0x%p for %16s\n", *BaseAddress, Process->ImageFileName);
>- MiInsertNode(&Process->VadRoot, (PVOID)Vad, Parent, Result);
>-
>- /* Release the working set */
>- MiUnlockProcessWorkingSetUnsafe(Process, Thread);
>-
>- /* Release the address space lock */
>- KeReleaseGuardedMutex(&Process->AddressCreationLock);
>-
>- /* Return the status */
>- return Status;
>+ }
>+ else
>+ {
>+ HighestAddress = (ULONG_PTR)MM_HIGHEST_VAD_ADDRESS;
>+ }
>+
>+ *BaseAddress = 0;
>+ Status = MiInsertVadEx((PMMVAD)Vad,
>+ BaseAddress,
>+ BYTES_TO_PAGES(Size),
>+ HighestAddress,
>+ PAGE_SIZE,
>+ MEM_TOP_DOWN);
>+ if (!NT_SUCCESS(Status))
>+ {
>+ ExFreePoolWithTag(Vad, 'ldaV');
>+ return STATUS_NO_MEMORY;
>+ }
>+
>+ /* Success */
>+ return STATUS_SUCCESS;
> }
>> VOID
>>>
_______________________________________________
Ros-dev mailing list
Ros-dev at reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.reactos.org/pipermail/ros-dev/attachments/20141011/7e19bbba/attachment.html>
More information about the Ros-dev
mailing list
CHAPTER VII. THE FOUR CLASSES OF SOCIETY. THE FOUR CLASSES OF SOCIETY. "After the herald had given the names of the wrestlers who were to make the first round, the fellows came in. They were dressed without any clothes to speak of, or rather they were quite undressed, with the exception of a cloth around their loins. They came in on opposite sides of the ring, and stood there about five feet apart, each man resting his hands on his knees, and glaring at the other like a wild beast. They[Pg 231] looked more like a pair of tigers than human beings, and for a moment I thought it was not at all unlike what a bull-fight in Spain might be. I turned upon her choking with anger, but her melting beauty rendered me helpless. Black woods were on our left. "Shall we turn in here?" I asked. "None of that with me," he growled. "Do you know who I am, Countess Lalage? I am Leon Lagage, Count of the Holy Roman Empire, and your husband. Incomparable woman, you cannot alter that fact. For better or worse, for richer or poorer, till death do us part!" I have in this way imperfectly indicated a methodical plan of generating a design, as far as words alone will serve, beginning with certain premises based upon a particular work to be performed, and then proceeding to consider in consecutive order the general character of the machine, mode of operation, movements and adjustments, general arrangement, strains, special arrangement, and proportions. ‘Alas! what is life, what is death, what are we, 11th January two best dresses. Commencement was as usual, with a few showers “All right,” agreed Sandy. “Dick, you and I are the ground crew. As soon as you’re ready, Mr. Whiteside, we’ll take hold!” Effects of Walpole's Administration—Formation of the new Ministry—Attitude of the Malcontents—Committee of Inquiry into Walpole's Administration—Walpole's Protectors—Ministerial Measures—Prorogation of Parliament—Disasters of the French—British Division in the Netherlands—Opening of Parliament—The German Mercenaries—Amendment of the Gin Act—George goes to Germany—Stair and De Noailles in Franconia—Stair in a Trap—Bold Resolution of King George—The Battle of Dettingen—Resignation of Stair—Retreat of the French—Negotiations for Peace—Treaty of Worms—Pelham becomes Prime Minister—The Attacks of Pitt on Carteret—Attempted Invasion of England—Its Failure—Progress of the French Arms—Frederick II. invades Bohemia—His Retirement—Resignation of Carteret—Pelham strengthens his Ministry—Death of the Emperor—Campaign in Flanders—Battle of Fontenoy—Campaign of Frederick II.—The Young Pretender's Preparations—Loss of the Elizabeth—Landing in the Hebrides—The Highland Clans join him—The First Brush—Raising of the Standard—Cope's Mistake—He turns aside at Dalwhinnie—Charles makes a Dash for Edinburgh—The March to Stirling—Right of the Dragoons—The "Canter of Coltbridge"—Edinburgh surprised by the Highlanders—Charles marching against Cope—Battle of Prestonpans—Delay in marching South—Discontent of the Highland Chiefs—The Start—Preparations in England—Apathy of the Aristocracy—Arrival of the Duke of Cumberland—Charles crosses the Border—Capture of Carlisle—The March to Derby—Resolution to retreat—"Black Friday"—The Retreat—Recapture of Carlisle—Siege of Stirling—Battle of Falkirk—Retreat to the Highlands—Cumberland's Pursuit—Gradual Collapse of the Highlanders—Battle of Culloden—Termination of the Rebellion—Cruelty of the Duke of Cumberland—Adventures of the Young Pretender—Trials and Executions—Ministerial Crisis. The next morning he was up betimes, and cooked the boys as good a breakfast as he could out of the remainder of his store and what he could get from the hospital, and then gave what was left to whoever came. The comfortable crib, which had cost the Deacon so much labor, had been pre-empted by the Surgeon for some of his weakest patients. "You two step forward one pace," he commanded. "Gentleman, I've got my six. The rest are yours." "Where are you goin'?" he said sternly. Every now and then the crowd would break into the latest rhymings of MacKinnon's poet: A large thicket, at this moment, gave the dusty foot an opportunity of doubling, and, for an instant, diverging from the straightforward course, though it availed him little, he seemed to feel the breath of his pursuer on the back of his neck; his foot sounded as if at his heels; he drew his garment closely around him, turned suddenly to the right, and, bounding from the ground, the next instant a splash was heard in the little river, and the fugitive was safe from his pursuer. HoME明日之后怎么免费刷一级纳米材料
ENTER NUMBET 0018www.wkcxy.com.cn www.feizaojv.com.cn bendangwu.com.cn scjk9999.com.cn aurumstar.com.cn dwcem.com.cn www.hxpn.com.cn jinei.com.cn www.aijiuge.com.cn www.hongqih7.com.cn