<br><br><div class="gmail_quote">2012/10/4 Paul Chitescu <span dir="ltr"><<a href="mailto:paulc@voip.null.ro" target="_blank">paulc@voip.null.ro</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Thursday 04 October 2012 08:25:13 am Dmitry Timoshkov wrote:<br>
> Christian Costa <<a href="mailto:titan.costa@gmail.com">titan.costa@gmail.com</a>> wrote:<br>
> >  PEPROCESS WINAPI IoGetCurrentProcess(void)<br>
> >  {<br>
> > -    FIXME("() stub\n");<br>
> > -    return NULL;<br>
> > +    TRACE("()\n");<br>
> > +<br>
> > +    /* Return current process id since PEPROCESS is opaque and drivers<br>
> > should not access the struct directly */ +    return<br>
> > (PEPROCESS)PsGetCurrentProcessId();<br>
> >  }<br>
><br>
> The returned pointer is supposed to be passed to various other ntoskrnl<br>
> APIs, and it's needs to be a valid pointer to the kernel object. Besides<br>
> many not trivial kernel drivers (if not all) really dig into internal<br>
> kernel structures.<br>
><br>
> Same for KeGetCurrentThread.<br>
<br>
</div></div>AFAIK the structure differs for each major version of Windows and some SP too.<br>
<br></blockquote><div><br></div><div>I was expecting something like this. :(</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
At the minimum I saw some drivers expecting that at the returned pointer to be<br>
a "System" C-style string.<br></blockquote><div><br></div><div>Which windows version it is ? In Vista definition the first basic element can be either an UCHAR or an ULONG. Not a char buffer.</div><div><br></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I tried submitting a patch before but was not accepted.<br>
<br>
</blockquote></div><br>