sdk: ptapi: Add program status codes
Signed-off-by: Chloe M. <chloe@yiffware.org>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Chloe M., et al.
|
||||
* Provided under the BSD-3 clause.
|
||||
*
|
||||
* Description: Program status codes
|
||||
* Author: Chloe M.
|
||||
*/
|
||||
|
||||
#ifndef _PTAPI_STATUS_H_
|
||||
#define _PTAPI_STATUS_H_ 1
|
||||
|
||||
#include <ptdef.h>
|
||||
|
||||
/*
|
||||
* All functions and routines that are to return a status code
|
||||
* should be of this return type.
|
||||
*/
|
||||
typedef ULONG PT_STATUS;
|
||||
|
||||
/* Valid status codes */
|
||||
#define STATUS_SUCCESS 0 /* Operation completed sucessfully */
|
||||
#define STATUS_FAILURE 1 /* Unspecified / generic failure */
|
||||
#define STATUS_NO_MEMORY 2 /* Out of memory */
|
||||
#define STATUS_NOT_DIRECTORY 3 /* Not a directory */
|
||||
#define STATUS_IO_ERROR 4 /* I/O error */
|
||||
#define STATUS_INVALID_PARAM 5 /* Invalid parameter */
|
||||
#define STATUS_ACCESS_DENIED 6 /* Access to resource is denied */
|
||||
|
||||
/*
|
||||
* Developers are encouraged to use this macro rather than directly
|
||||
* handling the conditional.
|
||||
*/
|
||||
#define PT_ERROR(STATUS) \
|
||||
((STATUS) != STATUS_SUCCESS)
|
||||
|
||||
#endif /* !_PTAPI_STATUS_H_ */
|
||||
Reference in New Issue
Block a user