#include "stdafx.h"
#include "utils.h"
#include "reghelpers.h"

// Routine to read/write items of type REGSTRUCT. from/to the registry
// NOTE: Optimization is turned off for this routine because
// chokes on the syntax. Its a module globlopts.c
#pragma optimize("",off)

void ReadWriteRegItems(const HKEY hkey,REGSTRUCT *pData,int count,REGMODE emode)
{
	if (emode == READ)
	{
		for(int i=0;i<count;i++)
		{
			int temp;
			RegReadIntValue(hkey,pData->ptName,&temp);
			*(pData->pnValue) = temp;
			pData++;
		}
	}
	else
	{
		for(int i=0;i<count;i++)
		{
			RegWriteIntValue(hkey,pData->ptName,*(pData->pnValue));
			pData++;
		}
	}
}

#pragma optimize("",on)
