Prototype
E_RTN EMemory::SpaceInsert( ulonglong ullSpaceToInsertSize,
ulonglong ullOffset,
void *pBlockToFill,
ulonglong ullBlockToFillSize );

Cette fonction insère ullSpaceToInsertSize octet(s) à l'offset ullOffset. Tous les octets insérés sont tapissés à l'aide du bloc d'octets pBlockToFill.

L'offset peut être à l'intérieur de l'espace de travail ou à la limite finale externe (voir l'exemple pour l'insertion à l'offset 12).

 

Argument

ulonglong ullSpaceToInsertSize

taille qu'il faut insérer, en octets.

ulonglong ullOffset

offset où doit s'effectuer l'insertion.

void *pBlockToFill

adresse du bloc d'octets servant pour le nettoyage.

ulonglong ullBlockToFillSize

taille du bloc d'octets servant pour le nettoyage.

 

Retour

E_RTN

voir la section retour de la librairie Eclat.

 

Exemple

Description :

Isertion d'un espace de 3 octets nettoyé à l'aide du bloc d'octets 0x58 et 0x59 ("XY" en ASCII), à l'offset 0 puis à l'offset 6 puis à l'offset 12 (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.SpaceInsert( 3, 0, "XY", 2 );
eMem.TraceEx( _T("eMem") );
eMem.SpaceInsert( 3, 6, "XY", 2 );
eMem.TraceEx( _T("eMem") );
eMem.SpaceInsert( 3, 12, "XY", 2 ); // Insertion à la limite finale externe
eMem.TraceEx( _T("eMem") );

Sortie :

### Object EMemory 'eMem' Trace #
# Object address='0x0012F424', status='EMemory::ObjectStatus_Enable' (code '3').
# Buffer address='0x00000001', 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='0x0012F424', status='EMemory::ObjectStatus_Enable' (code '3').
# Buffer address='0x00000001', workspace size='9' byte(s).
# Array data from offset '0x00000000' to offset '0x00000008', length=9 byte(s).
# Offset start 0x00000000 58 59 58 41 42 43 44 45 46 .. .. .. .. .. .. .. [XYXABCDEF]
### End #

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

### Object EMemory 'eMem' Trace #
# Object address='0x0012F424', status='EMemory::ObjectStatus_Enable' (code '3').
# Buffer address='0x00000001', workspace size='15' byte(s).
# Array data from offset '0x00000000' to offset '0x0000000E', length=15 byte(s).
# Offset start 0x00000000 58 59 58 41 42 43 58 59 58 44 45 46 58 59 58 .. [XYXABCXYXDEFXYX]
### 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 08
  58
X
59
Y
58
X
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 0A 0B
  58
X
59
Y
58
X
41
A
42
B
43
C
58
X
59
Y
58
X
44
D
45
E
46
F

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

 

Voir aussi
E_RTN EMemory::SpaceInsert( ulonglong ullSpaceToInsertSize, ulonglong ullOffset );
E_RTN EMemory::SpaceInsert( ulonglong ullSpaceToInsertSize, ulonglong ullOffset, uchar ucByteToFill );
E_RTN EMemory::ByteInsert( uchar ucByteToInsert, ulonglong ullOffset = 0 );
E_RTN EMemory::BlockInsert( void *pBlockToInsert, ulonglong ullBlockToInsertSize, 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