OpenFileMapping crashes vlc
Posted: 27 Apr 2010 18:39
I'm trying to use the (native) Windows API function OpenFileMapping to map a shared memory block between a clx video output plugin (which will write into the memory) and another Windows process that lalls CreateFileMapping.
This works fine with a "vlc-emulator" proggy I compiled to test it out, but when I try it in the vlc plugin the call to OpenFileMapping crashes vlc in a way that leaves no traces. vlc just quits, no error messages, no console output, and the "messages" window that could give me a clue also disappears instantly.
If I skip the OpenFileMapping call, vlc runs normally (except for the error that occurs because there is no video buffer)
This is the code I use, it is called in the "Open" callback of my video output plugin:
It compiles and links without even a warning.
I found no references to this function in the vlc code, except for an OpenFileMappingA function in the win32.c, but these functions only seem to emulate the real thing, so it won't work with another WIndows process on the other side.
This works fine with a "vlc-emulator" proggy I compiled to test it out, but when I try it in the vlc plugin the call to OpenFileMapping crashes vlc in a way that leaves no traces. vlc just quits, no error messages, no console output, and the "messages" window that could give me a clue also disappears instantly.
If I skip the OpenFileMapping call, vlc runs normally (except for the error that occurs because there is no video buffer)
This is the code I use, it is called in the "Open" callback of my video output plugin:
Code: Select all
char szName[40];
sprintf(szName,"Global\\BlueMotionVlcHdr0");
HANDLE hdl = OpenFileMapping(
FILE_MAP_ALL_ACCESS, // read/write access
FALSE, // do not inherit the name
szName); // name of mapping object
I found no references to this function in the vlc code, except for an OpenFileMappingA function in the win32.c, but these functions only seem to emulate the real thing, so it won't work with another WIndows process on the other side.