C H A P T E R 2

Using Network Setup

SetHandleSize( (Handle) entityRefs, entityCount * sizeof(CfgEntityRef) ); err = MemError();

}

if ((err == noErr) && (entityInfos != nil)) {

SetHandleSize( (Handle) entityInfos, entityCount * sizeof(CfgEntityInfo) ); err = MemError();

}

 

if (err == noErr) {

 

if (entityRefs == nil) {

 

paramRefs = nil;

 

} else {

 

sRefs = HGetState( (Handle) entityRefs );

assert(MemError() ==

noErr);

 

HLock( (Handle) entityRefs );

assert(MemError() ==

noErr);

 

paramRefs = *entityRefs;

 

}

 

if (entityInfos == nil) {

 

paramInfos = nil;

 

} else {

 

sInfos = HGetState( (Handle) entityInfos );

assert(MemError() ==

noErr);

 

HLock( (Handle) entityInfos );

assert(MemError() ==

noErr);

 

paramInfos = *entityInfos;

 

}

 

err = OTCfgGetEntitiesList(dbRef, area, entityClass, entityType, &entityCount, paramRefs, paramInfos);

if (entityRefs != nil) {

 

 

HSetState( (Handle)

entityRefs, sRefs );

assert(MemError() ==

noErr);

 

 

}

 

 

if (entityInfos != nil)

{

 

HSetState( (Handle)

entityInfos, sInfos );

assert(MemError() ==

noErr);

 

 

32Working with Entities

Page 32
Image 32
Apple Network Setup manual NoErr HLock Handle entityRefs