Solved

MSMQ - Access rights problem on call to MQReceiveMessageByLookupId...

Posted on 2004-03-23
3
319 Views
Last Modified: 2012-06-27
Greetings,

    I am making the following call:

 // Peek at message with the given lookup identifier.
  hr = MQReceiveMessageByLookupId(
                                  hQueue,                // Handle of queue
                                  ullLookupId,           // Lookup identifier
                                  MQ_LOOKUP_PEEK_CURRENT // Access mode
                                  &msgProps,             // Message property structure
                                  NULL,                  // No OVERLAPPED structure
                                  NULL,                  // No callback function
                                  MQ_NO_TRANSACTION      // Not in a transaction
                                  );

 And receiving the following error:

 "The access rights of the queue for performing the action specified in dwLookupAction are not allowed for the user that opened the queue."

 The queue itself is a private queue accessed locally, and the security on it is setup such that full control is allowed by everyone and yet I still get this error... has anyone run into this problem? and if so how did they correct it? any help is appreciated. Btw, there are in fact 10 messages currently in the queue.

adgarcia13

PS: I have cross-posted this question in the Windows Programming topic area.
0
Comment
Question by:adgarcia13
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 10668622
As I wrote in http://www.experts-exchange.com:8080/Programming/Programming_Platforms/Win_Prog/Q_20929696.html - you need to MQOpenQueue with the dwAccess parameter set to MQ_PEEK_ACCESS | MQ_ADMIN_ACCESS or MQ_RECEIVE_ACCESS | MQ_ADMIN_ACCESS along with local admin privileges.
0
 

Author Comment

by:adgarcia13
ID: 10671098

It looks like in fact I was not setting the dwAccess parameter to MQ_RECEIVE_ACCESS, Thanks. On a different note, what is the best approach for reading a message from Que1, writing it to Que2, and subsequently deleting the original message from Que1 once the write to Que2 is successful?

adgarcia13
0
 
LVL 86

Expert Comment

by:jkr
ID: 10678996
Well, as you cannot explicitly delete messages from a queue, you'd MQ_ACTION_PEEK_CURRENT on the msg you want to place in the other queue, 'MQSendMessage()' that one and the use MQ_ACTION_RECEIVE to remove the msg from the 1st queue...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now