On Feb 18 19:14, J.H. vd Water wrote:
> Hi Corinna,
> 
> To answer some of your questions ...
> 
> >> How did you build getpwent?  Did you stop your Cygwin shell and restart
> >> it?  Can you please send the getpwent.exe.stackdump file?
> 
> I used my "regular" setup of Cygwin to compile the sourcefile. Perhaps it is
> there where I went wrong.
> 
> gcc -o getpwent -Wall -std=c99 -fno-builtin -pedantic getpwent.c

No, that's unnecessarily detailed, but certainly not wrong.

> And, yes, I restarted my Cygwin shell.
> 
> >And, is the machine a domain member machine or not?
> 
> No, not a member of any domain ...

The crash looks weird.  It looks like your machine doesn't return
the machine sid when it's requested.  Can you please run the following
test application as non-admin and as admin and paster the output for
both cases into your reply?  Hmm, maybe that's a windows XP thingy?
I didn't test this stuff on anything prior to Vista.

==== SNIP ====
#include <stdio.h>
#include <windows.h>
#include <ntstatus.h>
#include <ntsecapi.h>

int
main ()
{
  static LSA_OBJECT_ATTRIBUTES oa = { 0, 0, 0, 0, 0, 0 };
  HANDLE lsa;
  NTSTATUS status;

  status = LsaOpenPolicy (NULL, &oa, POLICY_VIEW_LOCAL_INFORMATION, &lsa);
  if (status == STATUS_SUCCESS)
    {
      PPOLICY_DNS_DOMAIN_INFO pdom;
      PPOLICY_ACCOUNT_DOMAIN_INFO adom;

      status = LsaQueryInformationPolicy (lsa, PolicyDnsDomainInformation,
                                          (PVOID *) &pdom);
      if (status == STATUS_SUCCESS)
        {
          printf ("pdom name: <%ls> dnsname: <%ls>, sid: %p\n",
                  pdom->Name.Buffer, pdom->DnsDomainName.Buffer, pdom->Sid);
          LsaFreeMemory (pdom);
        }
      else
        fprintf (stderr, "LsaQueryInformationPolicy(Primary) 0x%x", status);
      status = LsaQueryInformationPolicy (lsa, PolicyAccountDomainInformation,
                                            (PVOID *) &adom);
      if (status == STATUS_SUCCESS)
        {
          printf ("adom name: <%ls> sid: %p\n",
                  adom->DomainName.Buffer, adom->DomainSid);
          LsaFreeMemory (adom);
        }
      LsaClose (lsa);
    }
  return 0;
}
==== SNAP ====


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpSpVM99Y239.pgp
Description: PGP signature

Reply via email to