Esempio n. 1
0
BOOL FixFileRecord(PFILE_RECORD_HEADER file)
{
	//int sec = 2048;
	PUSHORT usa = PUSHORT(PUCHAR(file) + file->Ntfs.UsaOffset);
	PUSHORT sector = PUSHORT(file);
	
	if (file->Ntfs.UsaCount>4) 
		return FALSE;
	for (ULONG i=1;i<file->Ntfs.UsaCount;i++)
	{
		sector[255] = usa[i];
		sector+= 256;
	}
	
	return TRUE;
}
Esempio n. 2
0
extern ULONG BuildMVMTValue ( PVOID Value, USHORT Count, MVMT_VALUE Table[] )
{
 /***************************************************************************
  * Store the number of values.                                             *
  ***************************************************************************/

  PBYTE p = PBYTE(Value) ;

  if ( Value )
    *PUSHORT(p) = Count ;

  p += sizeof(Count) ;

 /***************************************************************************
  * Store the multiple values.                                              *
  ***************************************************************************/

  for ( int i=0; i<Count; i++ )
  {
    if ( Value )
      *PUSHORT(p) = Table[i].Type ;

    p += sizeof(Table[i].Type) ;

    if ( Value )
      *PUSHORT(p) = Table[i].Length ;

    p += sizeof(Table[i].Length) ;

    if ( Value )
      memcpy ( p, Table[i].Value, Table[i].Length ) ;

    p += Table[i].Length ;
  }

 /***************************************************************************
  * Return the total byte count.                                            *
  ***************************************************************************/

  return ( p - PBYTE(Value) ) ;
}