VOID NPSSetCustomText (
LPTSTR lpCustomErrorText
);
There is no return value.
To return net specific text with a standard Windows error code:
// setup Error and lpErrorString to be the error to be reported
NPSSetCustomText(lpErrorString);
return(Error);