/* * DCBundleInfo.c * DualityCore * * Created by IT on 10/9/06. * Copyright 2006 __MyCompanyName__. All rights reserved. * */ #include "DCProcessInfo.h" #include struct DCProcessInfo DCCreateProcessInfoForPSN(ProcessSerialNumber *psn) { struct DCProcessInfo processInfo; processInfo.psn = *psn; GetProcessPID(psn, &processInfo.pid); FSRef processFileRef; GetProcessBundleLocation(psn, &processFileRef); processInfo.bundleURL = CFURLCreateFromFSRef(NULL, &processFileRef); processInfo.bundle = CFBundleCreate(NULL, processInfo.bundleURL); processInfo.bundleIdentifier = CFBundleGetIdentifier(processInfo.bundle); return processInfo; } void DCProcessInfoDestroy(struct DCProcessInfo ProcessInfoRec) { CFRelease(ProcessInfoRec.bundle); CFRelease(ProcessInfoRec.bundleIdentifier); CFRelease(ProcessInfoRec.bundleURL); }