Browse Source

fixed more win64 memory pointer access issues, updated release build for win32 bit

Signed-off-by: fadedreamz <fadedreamz@gmail.com>
etomic
fadedreamz 8 years ago
parent
commit
0770115f9f
  1. BIN
      OSlibs/win/release/nanomsg.dll
  2. BIN
      OSlibs/win/release/nanomsg.lib
  3. BIN
      OSlibs/win/release/pthreadVC2.lib
  4. BIN
      OSlibs/win/release/pthreadvc2.dll
  5. 4
      crypto777/curve25519.c
  6. 8
      crypto777/iguana_OS.c
  7. 3
      iguana.vcxproj
  8. 4
      iguana/iguana_bundles.c
  9. 4
      iguana/iguana_json.c
  10. 7
      iguana/iguana_mofn.c
  11. 4
      iguana/iguana_unspents.c

BIN
OSlibs/win/release/nanomsg.dll

Binary file not shown.

BIN
OSlibs/win/release/nanomsg.lib

Binary file not shown.

BIN
OSlibs/win/release/pthreadVC2.lib

Binary file not shown.

BIN
OSlibs/win/release/pthreadvc2.dll

Binary file not shown.

4
crypto777/curve25519.c

@ -1839,7 +1839,11 @@ uint64_t acct777_validate(struct acct777_sig *sig,bits256 privkey,bits256 pubkey
struct acct777_sig checksig; uint64_t signerbits; int32_t datalen; uint8_t *serialized;
datalen = (int32_t)(sig->allocsize - sizeof(*sig));
checksig = *sig;
#if defined(_M_X64)
serialized = (uint8_t *)((unsigned char *)sig + sizeof(*sig));
#else
serialized = (uint8_t *)((long)sig + sizeof(*sig));
#endif
//{ int32_t i; for (i=0; i<datalen; i++) printf("%02x",serialized[i]); printf(" VALIDATE.%d?\n",datalen); }
acct777_sign(&checksig,privkey,pubkey,sig->timestamp,serialized,datalen);
if ( memcmp(checksig.sigbits.bytes,sig->sigbits.bytes,sizeof(checksig.sigbits)) != 0 )

8
crypto777/iguana_OS.c

@ -217,10 +217,18 @@ static uint64_t _align16(uint64_t ptrval) { if ( (ptrval & 15) != 0 ) ptrval +=
void *myaligned_alloc(uint64_t allocsize)
{
void *ptr,*realptr; uint64_t tmp;
#if defined(_M_X64)
realptr = mycalloc('A', 1, (uint64_t)(allocsize + 16 + sizeof(realptr)));
#else
realptr = mycalloc('A',1,(long)(allocsize + 16 + sizeof(realptr)));
#endif
tmp = _align16((long)realptr + sizeof(ptr));
memcpy(&ptr,&tmp,sizeof(ptr));
#if defined(_M_X64)
memcpy((void *)((unsigned char *)ptr - sizeof(realptr)), &realptr, sizeof(realptr));
#else
memcpy((void *)((long)ptr - sizeof(realptr)),&realptr,sizeof(realptr));
#endif
//printf("aligned_alloc(%llu) realptr.%p -> ptr.%p, diff.%ld\n",(long long)allocsize,realptr,ptr,((long)ptr - (long)realptr));
return(ptr);
}

3
iguana.vcxproj

@ -132,7 +132,8 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Ws2_32.lib;pthreadVC2.lib;nanomsg.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>.\OSlibs\win\release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

4
iguana/iguana_bundles.c

@ -435,7 +435,11 @@ struct iguana_txid *iguana_bundletx(struct iguana_info *coin,struct iguana_bundl
iguana_peerfname(coin,&hdrsi,iter==0?"DB/ro":"DB",fname,0,bp->hashes[0],zero,bp->n,1);
if ( (fp= fopen(fname,"rb")) != 0 )
{
#if defined(_M_X64)
fseek(fp, (uint64_t)&rdata.Toffset - (uint64_t)&rdata, SEEK_SET);
#else
fseek(fp,(long)&rdata.Toffset - (long)&rdata,SEEK_SET);
#endif
if ( fread(&Toffset,1,sizeof(Toffset),fp) == sizeof(Toffset) )
{
fseek(fp,Toffset + sizeof(struct iguana_txid) * txidind,SEEK_SET);

4
iguana/iguana_json.c

@ -263,7 +263,11 @@ int32_t template_emit(char *retbuf,int32_t maxsize,char *template,char *varname,
varnamelen = (int32_t)strlen(varname);
while ( (match= strstr(varname,&template[offset])) != 0 )
{
#if defined(_M_X64)
position = (int32_t)((uint64_t)match - (uint64_t)&template[offset]);
#else
position = (int32_t)((long)match - (long)&template[offset]);
#endif
printf("found match.(%s) at %d offset.%d\n",varname,position,offset);
if ( size + (valuelen + position) > maxsize )
return(-1);

7
iguana/iguana_mofn.c

@ -563,10 +563,17 @@ int32_t test_mofn256(struct supernet_info *myinfo,int32_t M,int32_t N)
if ( m >= M )
printf("%s %s error m.%d vs M.%d N.%d\n",bits256_str(str,secret),bits256_str(str2,recover),m,mofn->M,mofn->N);
}
#if defined(_M_X64)
if (((uint64_t)mofn - (uint64_t)space) >= sizeof(space) || ((uint64_t)mofn - (uint64_t)space) < 0)
free(mofn);
if (((uint64_t)cmp - (uint64_t)space) >= sizeof(space) || ((uint64_t)cmp - (uint64_t)space) < 0)
free(cmp);
#else
if ( ((long)mofn - (long)space) >= sizeof(space) || ((long)mofn - (long)space) < 0 )
free(mofn);
if ( ((long)cmp - (long)space) >= sizeof(space) || ((long)cmp - (long)space) < 0 )
free(cmp);
#endif
return(retval);
}

4
iguana/iguana_unspents.c

@ -1416,7 +1416,11 @@ int32_t iguana_utxoaddr_map(struct iguana_info *coin,char *fname)
memcpy(&last,(void *)((long)coin->utxoaddrfileptr+sizeof(uint64_t)),sizeof(last));
memcpy(&coin->utxoaddrind,(void *)((long)coin->utxoaddrfileptr+sizeof(uint64_t)+sizeof(uint32_t)),sizeof(coin->utxoaddrind));
memcpy(&coin->utxoaddrhash.bytes,(void *)((long)coin->utxoaddrfileptr+sizeof(uint64_t)+2*sizeof(uint32_t)),sizeof(coin->utxoaddrhash));
#if defined(_M_X64)
coin->utxoaddroffsets = (void *)((unsigned char *)coin->utxoaddrfileptr + sizeof(uint64_t) + 2 * sizeof(uint32_t) + sizeof(bits256));
#else
coin->utxoaddroffsets = (void *)((long)coin->utxoaddrfileptr + sizeof(uint64_t) + 2*sizeof(uint32_t) + sizeof(bits256));
#endif
for (ind=total=count=0; ind<0x10000; ind++)
{
if ( (offset= coin->utxoaddroffsets[ind]) != 0 )

Loading…
Cancel
Save