NewsBot
1
UINT __stdcall CreateUUID()
{
** *UUID uuid;
** *HKEY hOpenKey = NULL;
** *if( UuidCreate( &uuid ) == RPC_S_OK )
** *{
******* char *oldStr = NULL;
******* char *tmpBin = NULL;
******* int ret;
******* tmpBin = (char *) &uuid;
******* oldStr = new char[22];
******* ret = base64encode( tmpBin, oldStr, sizeof(UUID),* 22);
** *** *// now add bytes
** *** *char* newStr = new char[44];
** *** *for (int i = 0; i < 22; i++)
** *** *{
** *** *** *newStr[i*2] = oldStr;
** *** *** *newStr[i*2 + 1] = 0;
** *** *}
** *** *
** *** *DWORD dwDisp;
** *** *if( RegCreateKeyEx( HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\My Company\Client"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hOpenKey, &dwDisp ) == ERROR_SUCCESS )
** *** *{
** *** *** *// only update key if it doeson't exist
** *** *** *if(dwDisp == REG_CREATED_NEW_KEY){
** *** *** *** *RegSetValueEx( hOpenKey, L"MyUUID", 0, REG_SZ, (unsigned char *) (newStr), 44 );
** *** *** *** *RegCloseKey( hOpenKey );
** *** *** *}
** *** *}
** *}
** *return ERROR_SUCCESS;
}
More...
View All Our Microsoft Related Feeds
{
** *UUID uuid;
** *HKEY hOpenKey = NULL;
** *if( UuidCreate( &uuid ) == RPC_S_OK )
** *{
******* char *oldStr = NULL;
******* char *tmpBin = NULL;
******* int ret;
******* tmpBin = (char *) &uuid;
******* oldStr = new char[22];
******* ret = base64encode( tmpBin, oldStr, sizeof(UUID),* 22);
** *** *// now add bytes
** *** *char* newStr = new char[44];
** *** *for (int i = 0; i < 22; i++)
** *** *{
** *** *** *newStr[i*2] = oldStr;
** *** *** *newStr[i*2 + 1] = 0;
** *** *}
** *** *
** *** *DWORD dwDisp;
** *** *if( RegCreateKeyEx( HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\My Company\Client"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hOpenKey, &dwDisp ) == ERROR_SUCCESS )
** *** *{
** *** *** *// only update key if it doeson't exist
** *** *** *if(dwDisp == REG_CREATED_NEW_KEY){
** *** *** *** *RegSetValueEx( hOpenKey, L"MyUUID", 0, REG_SZ, (unsigned char *) (newStr), 44 );
** *** *** *** *RegCloseKey( hOpenKey );
** *** *** *}
** *** *}
** *}
** *return ERROR_SUCCESS;
}
More...
View All Our Microsoft Related Feeds