Prototype
E_RTN EMemory::BlockInsert( void *pBlockToInsert,
ulonglong ullBlockToInsertSize,
ulonglong ullOffset = 0 );

Cette fonction insère le bloc d'octets pBlockToInsert à l'offset ullOffset.

L'offset peut être à l'intérieur de l'espace de travail ou à la limite finale externe (voir exemple pour l'insertion du bloc d'octets 0x59 et 0x5A).

 

Argument

void *pBlockToInsert

adresse du bloc d'octets à insérer.

ulonglong ullBlockToInsertSize

taille du bloc d'octets à insérer.

ulonglong ullOffset = 0

offset où doit s'effectuer l'insertion.

 

Retour

E_RTN

voir la section retour de la librairie Eclat.

 

Exemple

Description :

Insertion d'un bloc d'octets 0x55 et 0x56 ("UV" en ASCII) à l'offset 0, d'un bloc d'octets 0x57 et 0x58 ("WX" en ASCII) à l'offset 5 et d'un bloc d'octets 0x59 et 0x5A ("YZ" en ASCII) à l'offset 10 (limite finale externe) d'un objet EMemory alloué de 6 octets contenant les données 0x41, 0x42, 0x43, 0x44, 0x45 et 0x46 ("ABCDEF" en ASCII).

Code :

EMemory eMem( "ABCDEF", 6 ); // objet EMemory alloué de 6 octets

eMem.TraceEx( _T("eMem") );
eMem.BlockInsert( "UV", 2, 0 );
eMem.TraceEx( _T("eMem") );
eMem.BlockInsert( "WX", 2, 5 );
eMem.TraceEx( _T("eMem") );
eMem.BlockInsert( "YZ", 2, 10 );
eMem.TraceEx( _T("eMem") );

Sortie :

### Object EMemory 'eMem' Trace #
# Object address='0x0012F454', status='EMemory::ObjectStatus_Enable' (code '3').
# Buffer address='0x00000002', workspace size='6' byte(s).
# Array data from offset '0x00000000' to offset '0x00000005', length=6 byte(s).
# Offset start 0x00000000 41 42 43 44 45 46 .. .. .. .. .. .. .. .. .. .. [ABCDEF]
### End #

### Object EMemory 'eMem' Trace #
# Object address='0x0012F454', status='EMemory::ObjectStatus_Enable' (code '3').
# Buffer address='0x00000002', workspace size='8' byte(s).
# Array data from offset '0x00000000' to offset '0x00000007', length=8 byte(s).
# Offset start 0x00000000 55 56 41 42 43 44 45 46 .. .. .. .. .. .. .. .. [UVABCDEF]
### End #

### Object EMemory 'eMem' Trace #
# Object address='0x0012F454', status='EMemory::ObjectStatus_Enable' (code '3').
# Buffer address='0x00000002', workspace size='10' byte(s).
# Array data from offset '0x00000000' to offset '0x00000009', length=10 byte(s).
# Offset start 0x00000000 55 56 41 42 43 57 58 44 45 46 .. .. .. .. .. .. [UVABCWXDEF]
### End #

### Object EMemory 'eMem' Trace #
# Object address='0x0012F454', status='EMemory::ObjectStatus_Enable' (code '3').
# Buffer address='0x00000002', workspace size='12' byte(s).
# Array data from offset '0x00000000' to offset '0x0000000B', length=12 byte(s).
# Offset start 0x00000000 55 56 41 42 43 57 58 44 45 46 59 5A .. .. .. .. [UVABCWXDEFYZ]
### End #

Vue :

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E ..
  00 01 02 03 04 05
  41
A
42
B
43
C
44
D
45
E
46
F

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E ..
  00 01 02 03 04 05 06 07
  55
U
56
V
41
A
42
B
43
C
44
D
45
E
46
F

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E ..
  00 01 02 03 04 05 06 07 08 09
  55
U
56
V
41
A
42
B
43
C
57
W
58
X
44
D
45
E
46
F

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E ..
  00 01 02 03 04 05 06 07 08 09 0A 0B
  55
U
56
V
41
A
42
B
43
C
57
W
58
X
44
D
45
E
46
F
59
Y
5A
Z

 

Voir aussi
E_RTN EMemory::SpaceInsert( ulonglong ullSpaceToInsertSize, ulonglong ullOffset );
E_RTN EMemory::SpaceInsert( ulonglong ullSpaceToInsertSize, ulonglong ullOffset, uchar ucByteToFill );
E_RTN EMemory::SpaceInsert( ulonglong ullSpaceToInsertSize, ulonglong ullOffset, void *pBlockToFill, ulonglong ullBlockToFillSize );
E_RTN EMemory::ByteInsert( uchar ucByteToInsert, ulonglong ullOffset = 0 );
E_RTN EMemory::SpaceInsertEach( ulonglong *pullSpaceCountInserted, ulonglong ullSpaceToInsertSize, ulonglong ullStepEach, BOOL bStartAtFirst, ulonglong ullOffset = 0, ulonglong ullOffsetSize = EMemory::SizeUpToEnd );
E_RTN EMemory::SpaceInsertEach( ulonglong *pullSpaceCountInserted, ulonglong ullSpaceToInsertSize, ulonglong ullStepEach, BOOL bStartAtFirst, uchar ucByteToFill, ulonglong ullOffset = 0, ulonglong ullOffsetSize = EMemory::SizeUpToEnd );
E_RTN EMemory::SpaceInsertEach( ulonglong *pullSpaceCountInserted, ulonglong ullSpaceToInsertSize, ulonglong ullStepEach, BOOL bStartAtFirst, void *pBlockToFill, ulonglong ullBlockToFillSize, ulonglong ullOffset = 0, ulonglong ullOffsetSize = EMemory::SizeUpToEnd );
E_RTN EMemory::ByteInsertEach( ulonglong *pullByteCountInserted, uchar ucByteToInsert, ulonglong ullStepEach, BOOL bStartAtFirst, ulonglong ullOffset = 0, ulonglong ullOffsetSize = EMemory::SizeUpToEnd );
E_RTN EMemory::BlockInsertEach( ulonglong *pullBlockCountInserted, void *pBlockToInsert, ulonglong ullBlockToInsertSize, ulonglong ullStepEach, BOOL bStartAtFirst, ulonglong ullOffset = 0, ulonglong ullOffsetSize = EMemory::SizeUpToEnd );

 

Minimum
Version 1.0.0