public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Kris Thielemans" <kris.thielemans@csc.mrc.ac.uk>
To: <anorland@hem2.passagen.se>
Cc: "Gnuwin" <cygwin@sourceware.cygnus.com>
Subject: LARGE_INTEGER in w32API 0.1.5
Date: Fri, 28 Jan 2000 04:19:00 -0000	[thread overview]
Message-ID: <000c01bf6989$ad007e70$1d4bb392@petnt1.rpms.ac.uk> (raw)

Hi

I'm having problems with LARGE_INTEGER (defined in winnt.h). Via the cygwin
mailing list I found out that in the distributed W32 API, LARGE_INTEGER and
LONGLONG are flawed. Mumit advised to download your w32api 0.1.5 which I
did. However, even
there, the LARGE_INTEGER is not compatible with Microsoft's. The following
code does not work:

LARGE_INTEGER a;
DWORD b = a.LowPart;

instead, we have to use
DWORD b = a.u.LowPart;

This fits (of course) with your definition

typedef union _LARGE_INTEGER {
	struct {
		DWORD LowPart;
		LONG HighPart;
	}_STRUCT_NAME(u);
	LONGLONG QuadPart;
} LARGE_INTEGER,*PLARGE_INTEGER;

compared to Visual C++ 5.0 (an extra struct in the union):

 #if defined(MIDL_PASS)
 typedef struct _LARGE_INTEGER {
 #else // MIDL_PASS
 typedef union _LARGE_INTEGER {
     struct {
         DWORD LowPart;
         LONG HighPart;
     };
     struct {
         DWORD LowPart;
         LONG HighPart;
     } u;
 #endif //MIDL_PASS
     LONGLONG QuadPart;
 } LARGE_INTEGER;



Thanks for providng the API !

Kris

PS :
for cygwin people. This API can be found on
http://www.acc.umu.se/~anorland/gnu-win32/

The standard distribution defines LONGLONG as double, and
typedef struct _LARGE_INTEGER
 {
   DWORD LowPart;
  LONG  HighPart;
 } LARGE_INTEGER, *PLARGE_INTEGER;



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

             reply	other threads:[~2000-01-28  4:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-28  4:19 Kris Thielemans [this message]
2000-01-28  5:50 N8TM
2000-01-29 11:46 ` Mumit Khan
2000-01-28  6:34 Earnie Boyd
2000-01-29 12:21 N8TM

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000c01bf6989$ad007e70$1d4bb392@petnt1.rpms.ac.uk' \
    --to=kris.thielemans@csc.mrc.ac.uk \
    --cc=anorland@hem2.passagen.se \
    --cc=cygwin@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).