Discussion:
rapi database question
Mark Ellis
2008-05-06 20:50:13 UTC
Permalink
Hi All

General inquiry, does anyone know why CeReadRecordProps and
CeWriteRecordProps for rapi1 are inside an #if SIZEOF_VOID_P == 4 ?

After a brief browse I can't see anything obvious that would break. I
also can't see this defined anywhere.

Mark
David Eriksson
2008-05-09 20:40:03 UTC
Permalink
Post by Mark Ellis
Hi All
General inquiry, does anyone know why CeReadRecordProps and
CeWriteRecordProps for rapi1 are inside an #if SIZEOF_VOID_P == 4 ?
After a brief browse I can't see anything obvious that would break. I
also can't see this defined anywhere.
SIZEOF_VOID_P is defined in rapi_config.h (generated by the configure
script, i.e. AC_CHECK_SIZEOF(void *) in configure.ac.in)

If this #define is of my making, I think that it is because it is very
important that CEVALUNION.lpwstr is read and written as a 32-bit value
and same for CEVALUNION.blob.lpb


Cheers,

David

(Writing from a hotel room in London :-)
--
Mark Ellis
2008-05-11 09:55:40 UTC
Permalink
Post by David Eriksson
Post by Mark Ellis
Hi All
General inquiry, does anyone know why CeReadRecordProps and
CeWriteRecordProps for rapi1 are inside an #if SIZEOF_VOID_P == 4 ?
After a brief browse I can't see anything obvious that would break. I
also can't see this defined anywhere.
SIZEOF_VOID_P is defined in rapi_config.h (generated by the configure
script, i.e. AC_CHECK_SIZEOF(void *) in configure.ac.in)
If this #define is of my making, I think that it is because it is very
important that CEVALUNION.lpwstr is read and written as a 32-bit value
and same for CEVALUNION.blob.lpb
Thanks David, that should give me something to think about for a while.
Post by David Eriksson
Cheers,
David
(Writing from a hotel room in London :-)
David Eriksson
2008-05-11 15:01:18 UTC
Permalink
Post by Mark Ellis
Post by David Eriksson
Post by Mark Ellis
Hi All
General inquiry, does anyone know why CeReadRecordProps and
CeWriteRecordProps for rapi1 are inside an #if SIZEOF_VOID_P == 4 ?
After a brief browse I can't see anything obvious that would break. I
also can't see this defined anywhere.
SIZEOF_VOID_P is defined in rapi_config.h (generated by the configure
script, i.e. AC_CHECK_SIZEOF(void *) in configure.ac.in)
If this #define is of my making, I think that it is because it is very
important that CEVALUNION.lpwstr is read and written as a 32-bit value
and same for CEVALUNION.blob.lpb
Thanks David, that should give me something to think about for a while.
For the sake of clarity: this would of course only be an issue on
platforms where a pointer is 64-bit.


Cheers,

David

(
Mark Ellis
2008-05-11 19:59:36 UTC
Permalink
Post by David Eriksson
Post by Mark Ellis
Post by David Eriksson
Post by Mark Ellis
Hi All
General inquiry, does anyone know why CeReadRecordProps and
CeWriteRecordProps for rapi1 are inside an #if SIZEOF_VOID_P == 4 ?
After a brief browse I can't see anything obvious that would break. I
also can't see this defined anywhere.
SIZEOF_VOID_P is defined in rapi_config.h (generated by the configure
script, i.e. AC_CHECK_SIZEOF(void *) in configure.ac.in)
If this #define is of my making, I think that it is because it is very
important that CEVALUNION.lpwstr is read and written as a 32-bit value
and same for CEVALUNION.blob.lpb
Thanks David, that should give me something to think about for a while.
For the sake of clarity: this would of course only be an issue on
platforms where a pointer is 64-bit.
I was expecting the problem here to be that interesting bit of pointer
arithmetic, but it seems not.

On 64 bit, CEVALUNION is 16 bytes long, because CEBLOB is 16 bytes.
CEVALUNION over the wire is 8 bytes. I guess the problem is because
CEBLOB is a struct of 2 members, each member gets allocated on 64 bit
boundaries, hence a 16 byte struct, even though they don't need this
much space.

Compiler quirks aren't my strength, do you know how to force this to the
correct size ?

Mark
Mark Ellis
2008-05-11 20:07:23 UTC
Permalink
Post by Mark Ellis
Post by David Eriksson
Post by Mark Ellis
Post by David Eriksson
Post by Mark Ellis
Hi All
General inquiry, does anyone know why CeReadRecordProps and
CeWriteRecordProps for rapi1 are inside an #if SIZEOF_VOID_P == 4 ?
After a brief browse I can't see anything obvious that would break. I
also can't see this defined anywhere.
SIZEOF_VOID_P is defined in rapi_config.h (generated by the configure
script, i.e. AC_CHECK_SIZEOF(void *) in configure.ac.in)
If this #define is of my making, I think that it is because it is very
important that CEVALUNION.lpwstr is read and written as a 32-bit value
and same for CEVALUNION.blob.lpb
Thanks David, that should give me something to think about for a while.
For the sake of clarity: this would of course only be an issue on
platforms where a pointer is 64-bit.
I was expecting the problem here to be that interesting bit of pointer
arithmetic, but it seems not.
On 64 bit, CEVALUNION is 16 bytes long, because CEBLOB is 16 bytes.
CEVALUNION over the wire is 8 bytes. I guess the problem is because
CEBLOB is a struct of 2 members, each member gets allocated on 64 bit
boundaries, hence a 16 byte struct, even though they don't need this
much space.
Compiler quirks aren't my strength, do you know how to force this to the
correct size ?
Scratch that, it's obviously not a boundary issue, it's because it needs
64 bits for an LPBYTE, this is going to be more fun than I thought.....

Mark

Continue reading on narkive:
Loading...