0x000006ba error if you open an existing queue on a Virtual Server


If you open an existing queue on a virtual server, you receive a 0x000006ba error.


A cluster resource DLL runs in the context of the local node. However, if you spawn a new process from the resource DLL, the new process runs in the context of the cluster. Message Queuing (also known as MSMQ) calls are made from the new process.


To work around this issue, follow these steps:
  1. Create a custom resource DLL in Microsoft Visual Studio 6.0.
  2. Add the following code to the do...while() loop in the xxxOnlineThread() call (error detection is removed from the code sample):
    RESOURCE_STATUS      resourceStatus;
    DWORD nStatus;
    STARTUPINFO StartupInfo;
    LPWSTR pszNameOfPropInError;
    LPWSTR pszExpandedDir = NULL;
    LPWSTR pszExpandedCommand = NULL;

    // Create Process parameters
    LPVOID Environment = NULL;
    HANDLE processToken;
    HANDLE currentProcess;
    HANDLE hEventLog;
    DWORD nStatus = ResUtilGetPropertiesToParameterBlock(
    reinterpret_cast<LPBYTE>( &pResourceEntry->props ),
    TRUE, // CheckForRequiredProperties
    // Perform resource-specific initialization before starting the app.
    if ( pResourceEntry->props.nUseNetworkName ) {
    // Create the new environment with the simulated net name.

    LPVOID Environment = NULL;
    Environment = ResUtilGetEnvironmentWithNetName(pResourceEntry->hResource);
    else {

    // get the current process token. If it fails, revert to using just the
    // system environment area
    currentProcess = GetCurrentProcess();
    OpenProcessToken(currentProcess, MAXIMUM_ALLOWED, &processToken);
    // Clone the current environment, picking up any changes that might have
    // been made after resmon started
    CreateEnvironmentBlock(&Environment, processToken, FALSE);
    // Expand the current directory parameter
    if (pResourceEntry->props.pszCurrentDirectory) {
    pszExpandedDir = xxxExpandEnvironmentStrings(pResourceEntry->props.pszCurrentDirectory);
    // Try to start the new process
    CreateProcess(<Enter Executable Name Here>,
    Environment, pszExpandedDir, &StartupInfo,
Note The "xxx" in the function call (pszExpandedDir = xxxExpandEnvironmentStrings(pResourceEntry->props.pszCurrentDirectory) corresponds to the name of the resource DLL.

This code does the following things:
  • The code sets up the environment block with the UseNetnameAsComputerName property (ResUtilGetEnvironmentWithNetName(...)).
  • The code saves this information to the environment block for the process (CreateEnvironmentBlock(...)).
  • The code creates a new process that runs in the context of the virtual server (CreateProcess(...)).

Make your Message Queuing calls in this new process.


This behavior is by design.

Id. de artículo: 305794 - Última revisión: 23 feb. 2007 - Revisión: 1