Corinna Vinschen
2011-10-13 10:33:32 UTC
Hi Teemu,
I move the discussion over to the cygwin-developers list.
There are some differences that I haven't figured out yet. But I
might actually wait for a beta version of Windows 8 before going
forward.
Your original mail got me thinking, so I installed the Windows 8 preview
in qemu/kvm, reverted the system to the good old start menu(*), and
installed Cygwin.
First I inspected the FAST_CWD datastructure, and from what I can see,
it resembles closely the *old* structure used before KB 2393802 on Vista
and W7:
typedef struct _FAST_CWD_8 {
LONG ReferenceCount;
HANDLE DirectoryHandle;
ULONG OldDismountCount;
UNICODE_STRING Path;
LONG FSCharacteristics;
WCHAR Buffer[MAX_PATH];
} FAST_CWD_8, *PFAST_CWD_8;
See? The only difference is apparently the addition of the
FSCharacteristics member from the current FAST_CWD structure on
Vista/W7.
That makes me a bit suspicious. Why on earth should the structure
layout be changed back without need? Maybe it has something to do
with an optimized structure layout on 64 bit?!?
Anyway, I will check in a patch, today or tomorrow, which adds code
to use the new structure on W8.
ntdll!RtlpCurDirRef and find_fast_cwd_pointer tries to find that
location.
Right, that's the idea since RtlpCurDirRef is not exported from ntdll,
unfortunately.
process, set a breakpoint on 'cwdstuff::override_win32_cwd'. Then `run'
to the breakpoint. The only reason that find_fast_cwd() isn't called is
the fact that the global fast_cwd_ptr pointer is not -1. So just set it
to -1 and then you can step through find_fast_cwd() and
find_fast_cwd_pointer().
Corinna
(*) I really hope Microsoft doesn't remove the old start menu entirely
from the OS. The new GUI which is supposed to replace the start
menu is only useful for tablets and playing, but not for serious
work, IMO.
I move the discussion over to the cygwin-developers list.
Hello Corinna,
(see below).
Cool.First of all, we need a copyright assignment from you before we can
accept non-trivial patches to Cygwin, see http://cygwin.com/contrib.html,
the "Before you get started" section.
I am going to do that just in case I actually get something workingaccept non-trivial patches to Cygwin, see http://cygwin.com/contrib.html,
the "Before you get started" section.
(see below).
Windows 8 will very likely support the FAST_CWD stuff, the problem is
just to find out how to find the global pointer pointing to the current
FAST_CWD structure, and then, if the FAST_CWD structure changed.
It does do that, the code looks almost the same as in Windows 7.just to find out how to find the global pointer pointing to the current
FAST_CWD structure, and then, if the FAST_CWD structure changed.
There are some differences that I haven't figured out yet. But I
might actually wait for a beta version of Windows 8 before going
forward.
in qemu/kvm, reverted the system to the good old start menu(*), and
installed Cygwin.
First I inspected the FAST_CWD datastructure, and from what I can see,
it resembles closely the *old* structure used before KB 2393802 on Vista
and W7:
typedef struct _FAST_CWD_8 {
LONG ReferenceCount;
HANDLE DirectoryHandle;
ULONG OldDismountCount;
UNICODE_STRING Path;
LONG FSCharacteristics;
WCHAR Buffer[MAX_PATH];
} FAST_CWD_8, *PFAST_CWD_8;
See? The only difference is apparently the addition of the
FSCharacteristics member from the current FAST_CWD structure on
Vista/W7.
That makes me a bit suspicious. Why on earth should the structure
layout be changed back without need? Maybe it has something to do
with an optimized structure layout on 64 bit?!?
Anyway, I will check in a patch, today or tomorrow, which adds code
to use the new structure on W8.
Therefore I don't want to disable this message. If you're interested
to get rid of it, it would be most helpful trying to track down how to
find the global FAST_CWD pointer in W8.
If I understood the code correctly f_cwd_ptr is the location ofto get rid of it, it would be most helpful trying to track down how to
find the global FAST_CWD pointer in W8.
ntdll!RtlpCurDirRef and find_fast_cwd_pointer tries to find that
location.
unfortunately.
For some reason I couldn't get breakpoints working when
debugging cygwin1.dll so I did some disassembling and found the
correct location for ntdll!RtlpCurDirRef in Windows 8 version of
ntdll (wow64).
Any hints for debugging the Cygwin dll itself as find_fast_cwd runs
once per session so it has been very difficult trying to get a
working breakpoint.
That's easy. Start a GDB session for, say /bin/ls. Before starting thedebugging cygwin1.dll so I did some disassembling and found the
correct location for ntdll!RtlpCurDirRef in Windows 8 version of
ntdll (wow64).
Any hints for debugging the Cygwin dll itself as find_fast_cwd runs
once per session so it has been very difficult trying to get a
working breakpoint.
process, set a breakpoint on 'cwdstuff::override_win32_cwd'. Then `run'
to the breakpoint. The only reason that find_fast_cwd() isn't called is
the fact that the global fast_cwd_ptr pointer is not -1. So just set it
to -1 and then you can step through find_fast_cwd() and
find_fast_cwd_pointer().
Corinna
(*) I really hope Microsoft doesn't remove the old start menu entirely
from the OS. The new GUI which is supposed to replace the start
menu is only useful for tablets and playing, but not for serious
work, IMO.
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat