HPROFILE create_profile( struct profile *profile ) { HPROFILE handle; EnterCriticalSection( &MSCMS_handle_cs ); if ((handle = alloc_profile_handle())) { DWORD_PTR index = (DWORD_PTR)handle - 1; memcpy( &profiletable[index], profile, sizeof(struct profile) ); } LeaveCriticalSection( &MSCMS_handle_cs ); return handle; }
HPROFILE create_profile( struct profile *profile ) { HPROFILE handle; EnterCriticalSection( &mscms_handle_cs ); if ((handle = alloc_profile_handle())) { DWORD_PTR index = (DWORD_PTR)handle - 1; profiletable[index] = *profile; } LeaveCriticalSection( &mscms_handle_cs ); return handle; }