This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: strange crashes on invocation
On Sep 28 12:42, Reini Urban wrote:
> 2010/9/28 Corinna Vinschen:
> > On Sep 27 18:32, Pierre A. Humblet wrote:
> >> Why do we need the user name so early? Does it date back to Win95 when the user
> >> shared was using the user name ? For the user fstab, it could be
> >> legitimate to insist
> >> that the passwd entry exists.
> >
> > Good point. ÂOTOH, fetching USERNAME from the environment might not be
> > as bad as I thought at first. Âcygheap_user::init is only called when
> > started from a native process. ÂSince USERNAME is usually set, we get a
> > valid user name which can be used as Cygwin user name if passwd is
> > missing. ÂAnd, in the unlikely case that USERNAME is not set *and*
> > /etc/passwd is missing, we just don't read the user fstab, as you
> > suggest. ÂDoes that sound feasible?
>
> Sure.
> But having a snapshot to test is better.
Won't happen, at least not in the near future. It turned out that
GetUserName is not the only problem. There are more calls to advapi32
in the DLL initialization and I found that it depends on the OS you're
trying this on.
AFAICS, there are two groups of OSes. Those which work with an
all-autoloaded advapi32 if only the GetUserName call is removed,
Windows 2000 and Windows 7. And those which apparently don't like
any autoloading of advapi32 during DLL initialization, Windows XP
and Windows Vista.
I have a local source tree in which I already dropped 37 of the 70
functions called from advapi32 by replacing them with their ntdll
counterparts. It still works fine on Windows 2000 and Windows 7,
and it still doesn't work on Windows XP and Vista for applications
which itself load advapi32 at load-time.
What's left are functions for which I don't see any replacement
in other DLLs at all:
CreateProcessAsUserW
CryptAcquireContextW
CryptGenRandom
CryptReleaseContext
DeregisterEventSource
GetSecurityInfo
GetUserNameW
LogonUserW
LookupAccountNameW
LookupAccountSidW
LsaClose
LsaEnumerateAccountRights
LsaFreeMemory
LsaNtStatusToWinError
LsaOpenPolicy
LsaRetrievePrivateData
LsaStorePrivateData
RegisterEventSourceA
ReportEventA
as well as all the registry functions:
RegCloseKey
RegCreateKeyExA
RegCreateKeyExW
RegEnumKeyExW
RegEnumValueW
RegGetKeySecurity
RegLoadKeyW
RegOpenKeyExA
RegOpenKeyExW
RegQueryInfoKeyA
RegQueryValueExA
RegQueryValueExW
RegSetValueExA
RegSetValueExW
I'll try to replace the registry calls and see if that helps. If not,
we're probably back to square one, and all the work I put into that was
for the birds.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat