2008-06-03 09:11 UTC+0100 Viktor Szakats (harbour.01 syenar hu)

* include/rdd.api
     + Added necessary conversions.
     ; NOTE: 3 functions are not yet implemented in Harbour.

   * contrib/hbw32/w32_regc.c
   * contrib/hbw32/tests/testreg.prg
     % Optimizations.
     * Formatting.

   * contrib/hbw32/w32_ole.c
     ! Fixed indentation.

   * contrib/hbhpdf/harupdf.c
     ! Fixed hpdf_ReadFromStream() fixed to not overflow 
       to buffer in hb_storlen_buffer().
This commit is contained in:
Viktor Szakats
2008-06-03 07:14:05 +00:00
parent 7a8e05235f
commit 83b872a811
6 changed files with 1993 additions and 1952 deletions

View File

@@ -8,6 +8,23 @@
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2008-06-03 09:11 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* include/rdd.api
+ Added necessary conversions.
; NOTE: 3 functions are not yet implemented in Harbour.
* contrib/hbw32/w32_regc.c
* contrib/hbw32/tests/testreg.prg
% Optimizations.
* Formatting.
* contrib/hbw32/w32_ole.c
! Fixed indentation.
* contrib/hbhpdf/harupdf.c
! Fixed hpdf_ReadFromStream() fixed to not overflow
to buffer in hb_storlen_buffer().
2008-06-03 01:31 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* source/vm/extend.c
! hb_storclen_buffer() fixed to free the passed buffer

View File

@@ -183,7 +183,7 @@ HB_FUNC( HPDF_READFROMSTREAM )
if( size < 1024 )
size = 1024;
buffer = ( HPDF_BYTE * ) hb_xgrab( size );
buffer = ( HPDF_BYTE * ) hb_xgrab( size + 1 );
hb_retnl( (long) HPDF_ReadFromStream( HPDF_Doc_par( 1 ), buffer, &size ) );

View File

@@ -6,12 +6,13 @@
PROCEDURE Main()
? GetRegistry( HKEY_CURRENT_USER, "Control Panel\Desktop", "Wallpaper" )
? w32_regRead( "HKCU\Control Panel\Desktop\Wallpaper" )
? w32_regRead( "" )
/* old API */
? ">" + hb_ValToStr( GetRegistry( HKEY_CURRENT_USER, "Control Panel\Desktop", "Wallpaper" ) ) + "<"
// ? w32_regWrite( "HKCU\Control Panel\Desktop\Wallpaper", "harbour.bmp" )
/* new API */
? ">" + hb_ValToStr( w32_regRead( "HKCU\Control Panel\Desktop\Wallpaper" ) ) + "<"
? ">" + hb_ValToStr( w32_regRead( "" ) ) + "<"
Inkey( 0 )
// ? w32_regWrite( "HKCU\Control Panel\Desktop\Wallpaper", "harbour.bmp" )
RETURN

File diff suppressed because it is too large Load Diff

View File

@@ -93,7 +93,7 @@ HB_FUNC( WIN32_REGCREATEKEYEX )
if( RegCreateKeyEx( hb_regkeyconv( hb_parnl( 1 ) ),
( const char * ) hb_parc( 2 ),
hb_parnl( 3 ),
0,
NULL,
hb_parnl( 5 ),
hb_parnl( 6 ),
@@ -101,10 +101,8 @@ HB_FUNC( WIN32_REGCREATEKEYEX )
&hWnd,
&nResult ) == ERROR_SUCCESS )
{
if( ISBYREF( 8 ) )
hb_stornl( ( ULONG ) hWnd, 8 );
if( ISBYREF( 9 ) )
hb_stornl( nResult, 9 );
hb_stornl( ( ULONG ) hWnd, 8 );
hb_stornl( nResult, 9 );
hb_retnl( ERROR_SUCCESS );
}
@@ -116,11 +114,13 @@ HB_FUNC( WIN32_REGOPENKEYEX )
{
HKEY hWnd;
if( RegOpenKeyEx( hb_regkeyconv( hb_parnl( 1 ) ), hb_parc( 2 ), 0, hb_parnl( 4 ), &hWnd ) == ERROR_SUCCESS )
if( RegOpenKeyEx( hb_regkeyconv( hb_parnl( 1 ) ),
hb_parc( 2 ),
0,
hb_parnl( 4 ),
&hWnd ) == ERROR_SUCCESS )
{
if( ISBYREF( 5 ) )
hb_stornl( ( ULONG ) hWnd, 5 );
hb_stornl( ( ULONG ) hWnd, 5 );
hb_retnl( ERROR_SUCCESS );
}
else
@@ -133,20 +133,26 @@ HB_FUNC( WIN32_REGQUERYVALUEEX )
DWORD nType = 0;
DWORD nSize = 0;
if( RegQueryValueEx( hb_regkeyconv( hb_parnl( 1 ) ), cKey, 0, &nType, 0, &nSize ) == ERROR_SUCCESS )
if( RegQueryValueEx( hb_regkeyconv( hb_parnl( 1 ) ),
cKey,
NULL,
&nType,
NULL,
&nSize ) == ERROR_SUCCESS )
{
if( nSize > 0 )
{
BYTE * cValue = ( BYTE * ) hb_xgrab( nSize );
BYTE * cValue = ( BYTE * ) hb_xgrab( nSize + 1 );
RegQueryValueEx( hb_regkeyconv( hb_parnl( 1 ) ), cKey, 0, &nType, ( BYTE * ) cValue, &nSize );
RegQueryValueEx( hb_regkeyconv( hb_parnl( 1 ) ),
cKey,
NULL,
&nType,
( BYTE * ) cValue,
&nSize );
if( ISBYREF( 4 ) )
hb_stornl( nType, 4 );
if( ISBYREF( 5 ) )
hb_storclen( ( char * ) cValue, nSize, 5 );
hb_xfree( cValue );
hb_stornl( nType, 4 );
hb_storclen_buffer( ( char * ) cValue, nSize, 5 );
}
}
@@ -160,13 +166,23 @@ HB_FUNC( WIN32_REGSETVALUEEX )
if( nType != REG_DWORD )
{
BYTE * cValue = ( BYTE *) hb_parc( 5 );
hb_retni( RegSetValueEx( hb_regkeyconv( hb_parnl( 1 ) ), cKey, 0, nType, ( BYTE * ) cValue, hb_parclen( 5 ) + 1 ) );
BYTE * cValue = ( BYTE * ) hb_parc( 5 );
hb_retni( RegSetValueEx( hb_regkeyconv( hb_parnl( 1 ) ),
cKey,
0,
nType,
( BYTE * ) cValue,
hb_parclen( 5 ) + 1 ) );
}
else
{
DWORD nSpace = hb_parnl( 5 );
hb_retni( RegSetValueEx( hb_regkeyconv( hb_parnl( 1 ) ), cKey, 0, nType, ( BYTE * ) &nSpace, sizeof( REG_DWORD ) ) );
hb_retni( RegSetValueEx( hb_regkeyconv( hb_parnl( 1 ) ),
cKey,
0,
nType,
( BYTE * ) &nSpace,
sizeof( REG_DWORD ) ) );
}
}

View File

@@ -59,4 +59,11 @@
#include "hbapirdd.h"
#include "item.api"
#define _rddInherit hb_rddInherit
#if 0
#define _rddDisinherit( x ) hb_rddDisinherit( ( const char * ) x )
#define _rddExtendType hb_rddExtendType
#define _rddFieldType hb_rddFieldType
#endif
#endif /* _RDD_API */