Hi,
I’m currently trying to write an application using the Notes C API on MacOS, I’ve hit a bug on the PPC build of my code which I cannot fathom myself. I’ve included a section of code below.
The NSFItemInfo() call returns a blockID which looks valid, compared to the kinds of numbers I see on the working x86 build. However, when I call NSFItemQuery() it panics with trying to lock a handle; OSLockHandle, called from NSFItemQuery causes a panic. I can’t work out why this is happening, the code works perfectly on x86 and the documentation does not mention any problems to do with canonical form data using this call.
The error I get in my app is:
Thread=[170FE:0002-A0869830]
Stack base=0xBFFFDAD4, Stack size = 63156 bytes
PANIC: 01:36
I’ve also tried it outside of my app in another, smaller, test case program. I get a slightly different trace but it still isn’t much use to me.
Thread=[171EF:0002-A0869830]
Stack base=0xBFFEDC54, Stack size = -3196 bytes
PANIC: LookupHandle: null handle
The sample code from my program is below:
BLOCKID blockID;
unsigned short dataType;
BLOCKID valueBlockID;
unsigned long valueLength;
STATUS err = NSFItemInfo(noteHandle, NULL, 0, &blockID, &dataType, &valueBlockID, &valueLength);
while (err == 0)
{
char nameStr[MAXSPRINTF];
unsigned short nameLen, flags, type;
NSFItemQuery(noteHandle, blockID, nameStr, sizeof(nameStr), &nameLen, &flags, &type, &valueBlockID, &valueLength);
nameStr[nameLen] = '\0';
array = [array arrayByAddingObject:[NSString stringWithCString:nameStr encoding:NSASCIIStringEncoding]];
err = NSFItemInfoNext(noteHandle, blockID, NULL, 0, &blockID, &dataType, &valueBlockID, &valueLength);
}
If anyone has any ideas, I’ve looked at endian issues, possible calling convention issues and I’m out of ideas.
Regards,
Matt