why create/open global event in Metro style app is denied RRS feed

  • Question

  • Hi MSFT,

     I am trying to create/open a global event in Metro style app, but it always failed with access denied error. the code is as below:

     HANDLE hSyncEvent = OpenEventW( EVENT_MODIFY_STATE, FALSE, L"Global\\D51957AA-BA9E-46BE-90BC-7BDE8BCA6148");
     if(NULL == hSyncEvent || ERROR_INVALID_HANDLE == GetLastError() /*||ERROR_ALREADY_EXISTS == GetLastError()*/)
      DWORD err = GetLastError();
      printf( "CreateEvent error: %d 0x%X\n", err, err );
      return false;

    The error code is 5, while I am able to open this global event in Desktop mode application, so what's the problem of global event in Metro app?

    Qiusheng Xie

    Wednesday, August 15, 2012 2:00 AM


  • This is expected. The new style Windows 8 apps are sandboxed so they cannot interact with the system as a whole. They can communicate only within their own package or via controlled paths such as contracts.


    • Marked as answer by Qiusheng Xie Wednesday, August 15, 2012 2:34 AM
    Wednesday, August 15, 2012 2:19 AM