Hi All,
From ntdef.h (Windows 2003 DDK)
>>
typedef unsigned long ULONG;
>
As is mentioned in numerous places “ULONG is still 32-bit even on a 64-bit
Windows”, that means ‘unsigned long’/long are still 32 bits as well.
I was surprised to see this. I must admit, this is my first brush with
64-bit development, I am porting a 32-bit driver for x86 to AMD64 platform.
Is long/unsigned long 32 bit only with Microsoft C compiler?
Isn’t default size for long/unsigned long 64-bit for on 64-bit machine and
32 bit on a 32-bit machine?
Thanks,
Bandeep
LONG or long has always been 32 bits, also within 16 bit code and within 64 bit code, compilers , processors , etc…
Only *int* varies from 16 to 32 to 64 depending on the target you compile for …
And indeed : INT ( int ) is not *always* equal to LONG ( long ) !
----- Original Message -----
From: “Bandeep Singh”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, August 23, 2004 4:08 PM
Subject: [ntdev] size of long on 64-bit
> Hi All,
>
> >From ntdef.h (Windows 2003 DDK)
> >>
> typedef unsigned long ULONG;
> >>
>
> As is mentioned in numerous places “ULONG is still 32-bit even on a 64-bit
> Windows”, that means ‘unsigned long’/long are still 32 bits as well.
>
> I was surprised to see this. I must admit, this is my first brush with
> 64-bit development, I am porting a 32-bit driver for x86 to AMD64 platform.
>
> Is long/unsigned long 32 bit only with Microsoft C compiler?
>
> Isn’t default size for long/unsigned long 64-bit for on 64-bit machine and
> 32 bit on a 32-bit machine?
>
> Thanks,
> Bandeep
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> Only *int* varies from 16 to 32 to 64 depending on the target you compile
for
int is 32 bit as well on 64-bit Windows.
-Bandeep
“Christiaan Ghijselinck” wrote in
message news:xxxxx@ntdev…
>
>
> LONG or long has always been 32 bits, also within 16 bit code and within
64 bit code, compilers , processors , etc…
> Only int varies from 16 to 32 to 64 depending on the target you compile
for …
>
> And indeed : INT ( int ) is not always equal to LONG ( long ) !
>
>
> ----- Original Message -----
> From: “Bandeep Singh”
> Newsgroups: ntdev
> To: “Windows System Software Devs Interest List”
> Sent: Monday, August 23, 2004 4:08 PM
> Subject: [ntdev] size of long on 64-bit
>
>
> > Hi All,
> >
> > >From ntdef.h (Windows 2003 DDK)
> > >>
> > typedef unsigned long ULONG;
> > >>
> >
> > As is mentioned in numerous places “ULONG is still 32-bit even on a
64-bit
> > Windows”, that means ‘unsigned long’/long are still 32 bits as well.
> >
> > I was surprised to see this. I must admit, this is my first brush with
> > 64-bit development, I am porting a 32-bit driver for x86 to AMD64
platform.
> >
> > Is long/unsigned long 32 bit only with Microsoft C compiler?
> >
> > Isn’t default size for long/unsigned long 64-bit for on 64-bit machine
and
> > 32 bit on a 32-bit machine?
> >
> > Thanks,
> > Bandeep
> >
> >
> >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
xxxxx@compaqnet.be
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
With 32 bit long, int cannot be 64 bit.
According to standard, int has to be “natural” size for a specific platform
- so it would be possible to implement 32 bit int, 64 bit long or 64 bit
int, 64 bit long. Unfortunately, there are tons of existing code that
assumes 32 bit int, 32 bit long and/or sizeof(int) == sizeof(long). There
was a lot of discussion on this topic several years ago, when C99 standard
was finalized. So - we have now 32 bit int, 32 bit long and 64 bit long
long.
Regards,
Alex Krol
-----Original Message-----
From: Christiaan Ghijselinck
[mailto:xxxxx@CompaqNet.be]
Sent: Monday, August 23, 2004 4:23 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] size of long on 64-bit
LONG or long has always been 32 bits, also within 16 bit code and within 64
bit code, compilers , processors , etc…
Only *int* varies from 16 to 32 to 64 depending on the target you compile
for …
And indeed : INT ( int ) is not *always* equal to LONG ( long ) !
----- Original Message -----
From: “Bandeep Singh”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, August 23, 2004 4:08 PM
Subject: [ntdev] size of long on 64-bit
> Hi All,
>
> >From ntdef.h (Windows 2003 DDK)
> >>
> typedef unsigned long ULONG;
> >>
>
> As is mentioned in numerous places “ULONG is still 32-bit even on a 64-bit
> Windows”, that means ‘unsigned long’/long are still 32 bits as well.
>
> I was surprised to see this. I must admit, this is my first brush with
> 64-bit development, I am porting a 32-bit driver for x86 to AMD64
platform.
>
> Is long/unsigned long 32 bit only with Microsoft C compiler?
>
> Isn’t default size for long/unsigned long 64-bit for on 64-bit machine and
> 32 bit on a 32-bit machine?
>
> Thanks,
> Bandeep
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@creo.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Correct . I was probably too persuaded about my “wishful thinking” with the experience from the days that 16-bit “became” 32-bit .
Sorry about this.
----- Original Message -----
From: “Bandeep Singh”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Monday, August 23, 2004 4:39 PM
Subject: Re:[ntdev] size of long on 64-bit
> > Only int varies from 16 to 32 to 64 depending on the target you compile
> for
>
> int is 32 bit as well on 64-bit Windows.
>
> -Bandeep
>
>
>
>
> “Christiaan Ghijselinck” wrote in
> message news:xxxxx@ntdev…
> >
> >
> > LONG or long has always been 32 bits, also within 16 bit code and within
> 64 bit code, compilers , processors , etc…
> > Only int varies from 16 to 32 to 64 depending on the target you compile
> for …
> >
> > And indeed : INT ( int ) is not always equal to LONG ( long ) !
> >
> >
> > ----- Original Message -----
> > From: “Bandeep Singh”
> > Newsgroups: ntdev
> > To: “Windows System Software Devs Interest List”
> > Sent: Monday, August 23, 2004 4:08 PM
> > Subject: [ntdev] size of long on 64-bit
> >
> >
> > > Hi All,
> > >
> > > >From ntdef.h (Windows 2003 DDK)
> > > >>
> > > typedef unsigned long ULONG;
> > > >>
> > >
> > > As is mentioned in numerous places “ULONG is still 32-bit even on a
> 64-bit
> > > Windows”, that means ‘unsigned long’/long are still 32 bits as well.
> > >
> > > I was surprised to see this. I must admit, this is my first brush with
> > > 64-bit development, I am porting a 32-bit driver for x86 to AMD64
> platform.
> > >
> > > Is long/unsigned long 32 bit only with Microsoft C compiler?
> > >
> > > Isn’t default size for long/unsigned long 64-bit for on 64-bit machine
> and
> > > 32 bit on a 32-bit machine?
> > >
> > > Thanks,
> > > Bandeep
> > >
> > >
> > >
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as:
> xxxxx@compaqnet.be
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@compaqnet.be
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>