<p>I need to replace all WinAPI calls of the</p>

<ul>
<li>CreateFile, </li>
<li>ReadFile, </li>
<li>SetFilePointer,</li>
<li>CloseHandle </li>
</ul>

<p>with my own implementation (which use low-level file reading via Bluetooth).
The code, where functions will be replaced, is Video File Player and it already works with  the regular hdd files.
It is also needed, that Video Player still can play files from HDD, if the file in the VideoPlayer input is a regular hdd file.</p>

<p>What is the best practice for such task?</p>

I don't think this is best practice but it should work if you put it in an include file that's included everywhere the function you want to change is called:
```
```
#define CreateFile MyCreateFile

HRESULT MyCreateFile(whatever the params are);
```
```
Implementation of MyCreateFile looks something like this:
```
```
#undef CreateFile
HRESULT MyCreateFile(NobodyCanRememberParamListsLikeThat params)
{
    if (InputIsNormalFile())
        CreateFile(params);
    else
        // do your thing
}
```
```
You basically make every CreateFile call a MyCreateFile call where you can decide if you want need to use your own implementation or the orginal one.
Disclaimer: I think doing this is ugly and I wouldn't do it. I'd rather search and replace all occurences or something.