/*
- * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004, 2006 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
CFDictionaryRef dict;
- if (!store || (storePrivate->server == MACH_PORT_NULL)) {
+ if ((store == NULL) || (storePrivate->server == MACH_PORT_NULL)) {
return kSCStatusNoStoreSession; /* you must have an open session to play */
}
goto done;
}
- if (!mySession) {
+ if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
}
done :
- if (key) CFRelease(key);
+ if (key != NULL) CFRelease(key);
return KERN_SUCCESS;
}
SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store;
addSpecific myContext;
- if (!store || (storePrivate->server == MACH_PORT_NULL)) {
+ if ((store == NULL) || (storePrivate->server == MACH_PORT_NULL)) {
return kSCStatusNoStoreSession; /* you must have an open session to play */
}
*dataRef = NULL;
*dataLen = 0;
+ *sc_status = kSCStatusOK;
+
if (keysRef && (keysLen > 0)) {
/* un-serialize the keys */
if (!_SCUnserialize((CFPropertyListRef *)&keys, NULL, (void *)keysRef, keysLen)) {
*sc_status = kSCStatusFailed;
- goto done;
- }
-
- if (!isA_CFArray(keys)) {
- *sc_status = kSCStatusInvalidArgument;
- goto done;
}
}
/* un-serialize the patterns */
if (!_SCUnserialize((CFPropertyListRef *)&patterns, NULL, (void *)patternsRef, patternsLen)) {
*sc_status = kSCStatusFailed;
- goto done;
}
+ }
- if (!isA_CFArray(patterns)) {
- *sc_status = kSCStatusInvalidArgument;
- goto done;
- }
+ if (*sc_status != kSCStatusOK) {
+ goto done;
+ }
+
+ if ((keys != NULL) && !isA_CFArray(keys)) {
+ *sc_status = kSCStatusInvalidArgument;
+ goto done;
+ }
+
+ if ((patterns != NULL) && !isA_CFArray(patterns)) {
+ *sc_status = kSCStatusInvalidArgument;
+ goto done;
}
- if (!mySession) {
+ if (mySession == NULL) {
*sc_status = kSCStatusNoStoreSession; /* you must have an open session to play */
goto done;
}