I want to write a portable memory searching function. The signature looks similar to this:

```
return_type FindPattern(uintptr_t start, size_t length, const unsigned char* pattern, const char* mask);

```

The function scans the current process memory starting from the address `start`, for the next `length` bytes and returns the address of the first byte of the first byte sequence matching the given `pattern` with a given `mask`. If the pattern was not found, the function should somehow indicate this, perhaps via a special return value. The main concern is that the null pointer may not be equal to 0 on some platforms.

What return type is the best for this task and how to indicate if the pattern was not found?