22.12.2012 Views

Front cover - IBM Redbooks

Front cover - IBM Redbooks

Front cover - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

AddInLogMessageText ("short name=%s,length=%d\n", 0,*pUserShortName,*pUserShortNameLen);<br />

Exit:<br />

if ( pLookup && hLookup )<br />

OSUnlock(hLookup);<br />

NoUnlockExit:<br />

if (NULLHANDLE != hLookup)<br />

OSMemFree(hLookup);<br />

return rc;<br />

}<br />

int getLookupInfo (FilterContext* context,<br />

char *pMatch,<br />

unsigned short itemNumber,<br />

char **pInfo,<br />

int *pInfoLen) {<br />

/*<br />

* Description: Get the info from the lookup buffer<br />

*<br />

* Input: context context we'll use for allocating memory<br />

* pMatch the name of the lookup buffer<br />

* itemNumber where the info is stored in the lookup<br />

* buffer<br />

* Output: pInfo location of the info buffer<br />

* pInfoLen location to store the info length<br />

*<br />

* Return: -1 on error, 0 on success<br />

*/<br />

unsigned int reserved = 0;<br />

unsigned int errID;<br />

char *ValuePtr = NULL;<br />

WORD ValueLength, DataType;<br />

STATUS error;<br />

void *newSpace = NULL;<br />

/* Initialize output */<br />

*pInfo = NULL;<br />

*pInfoLen = 0;<br />

/* Check the type and length of the info */<br />

ValuePtr = (char *)NAMELocateItem2(pMatch,<br />

itemNumber,<br />

&DataType,<br />

&ValueLength);<br />

if (NULL == ValuePtr || ValueLength == 0) {<br />

return -1;<br />

Appendix B. A sample DSAPI program 651

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!