Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Access denied when calling the cluster-api (clusapi.dll)

Access denied when calling the cluster-api (clusapi.dll)

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++sysadminwindows-adminjson
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Calla
    wrote on last edited by
    #1

    Hi, I have an application that uses the cluster-api (clusapi.dll) on Windows Server 2003. When I run my application under the Administrator account the call to the method OpenCluster works fine, but the problem is that not all users of my application are in fact administrators and when I call GetLastError after the call fails it says: Access is denied I realize that someone belonging to the Users group are not allowed to make that call, but I can't find in MSDN (or anywhere else) why this is the case and I'd like to check if anyone knows a way around this. This code always returns NULL since hCluster is NULL after the call to OpenCluster:

    HCLUSTER hCluster;
    hCluster = OpenCluster( NULL );
    if( hCluster == NULL )
    {
    return NULL;
    }

    I'm more used to C# coding, but I have written a dll in C++ containing all the cluster functionality I need (and then using that dll in my C# project via p/Invoke). Any ideas around this would be appreciated. Thanks!

    L 1 Reply Last reply
    0
    • C Calla

      Hi, I have an application that uses the cluster-api (clusapi.dll) on Windows Server 2003. When I run my application under the Administrator account the call to the method OpenCluster works fine, but the problem is that not all users of my application are in fact administrators and when I call GetLastError after the call fails it says: Access is denied I realize that someone belonging to the Users group are not allowed to make that call, but I can't find in MSDN (or anywhere else) why this is the case and I'd like to check if anyone knows a way around this. This code always returns NULL since hCluster is NULL after the call to OpenCluster:

      HCLUSTER hCluster;
      hCluster = OpenCluster( NULL );
      if( hCluster == NULL )
      {
      return NULL;
      }

      I'm more used to C# coding, but I have written a dll in C++ containing all the cluster functionality I need (and then using that dll in my C# project via p/Invoke). Any ideas around this would be appreciated. Thanks!

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Calla wrote:

      I'd like to check if anyone knows a way around this.

      If you did find a way to circumvent security and Microsoft found out, they would likely fix the security hole and then the work around would no longer work anyway. It would be safer to just follow guidelines.

      C 1 Reply Last reply
      0
      • L led mike

        Calla wrote:

        I'd like to check if anyone knows a way around this.

        If you did find a way to circumvent security and Microsoft found out, they would likely fix the security hole and then the work around would no longer work anyway. It would be safer to just follow guidelines.

        C Offline
        C Offline
        Calla
        wrote on last edited by
        #3

        I guess you're right lm - thanks for your reply. So this is obviously done by design from MS. Well, do you know if there is a way to find out if an NT Service is part of a cluster group? That's what I really need to find out.

        L 1 Reply Last reply
        0
        • C Calla

          I guess you're right lm - thanks for your reply. So this is obviously done by design from MS. Well, do you know if there is a way to find out if an NT Service is part of a cluster group? That's what I really need to find out.

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Calla wrote:

          do you know if there is a way to find out if an NT Service is part of a cluster group?

          No, I have no experience with that scenario. Have you looked at the clustering API documentation[^]?

          C 1 Reply Last reply
          0
          • L led mike

            Calla wrote:

            do you know if there is a way to find out if an NT Service is part of a cluster group?

            No, I have no experience with that scenario. Have you looked at the clustering API documentation[^]?

            C Offline
            C Offline
            Calla
            wrote on last edited by
            #5

            Yes I have, but no luck yet :| Well, thanks anyway!

            L 1 Reply Last reply
            0
            • C Calla

              Yes I have, but no luck yet :| Well, thanks anyway!

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #6

              Calla wrote:

              Yes I have, but no luck yet

              Sure, it sort of makes sense since the point of clustering/balancing is that you should not have to know which specific machine something is running on. If I were in your shoes, I would want to make sure there is an actual need for what you are trying to do. It seems contradictory.

              R 1 Reply Last reply
              0
              • L led mike

                Calla wrote:

                Yes I have, but no luck yet

                Sure, it sort of makes sense since the point of clustering/balancing is that you should not have to know which specific machine something is running on. If I were in your shoes, I would want to make sure there is an actual need for what you are trying to do. It seems contradictory.

                R Offline
                R Offline
                Rajesh R Subramanian
                wrote on last edited by
                #7

                Hi Mike, I need your voice here: http://www.codeproject.com/Messages/3121978/How-to-access-a-remote-machine-from-a-local-machine-and-perform-basic-function-like-execute-and-close-the-remote-machines-application.aspx[^] :sigh:

                It is a crappy thing, but it's life -^ Carlo Pallini

                L 1 Reply Last reply
                0
                • R Rajesh R Subramanian

                  Hi Mike, I need your voice here: http://www.codeproject.com/Messages/3121978/How-to-access-a-remote-machine-from-a-local-machine-and-perform-basic-function-like-execute-and-close-the-remote-machines-application.aspx[^] :sigh:

                  It is a crappy thing, but it's life -^ Carlo Pallini

                  L Offline
                  L Offline
                  led mike
                  wrote on last edited by
                  #8

                  Yes I see your thread is a perfect example of why the HOW TO ANSWER A QUESTION message from Maunder is ridiculous. Anyway, because of that, I don't supply my voice in these forums any longer. See my BIO which I updated to that effect. http://www.codeproject.com/script/Membership/View.aspx?mid=2940943[^]

                  R 1 Reply Last reply
                  0
                  • L led mike

                    Yes I see your thread is a perfect example of why the HOW TO ANSWER A QUESTION message from Maunder is ridiculous. Anyway, because of that, I don't supply my voice in these forums any longer. See my BIO which I updated to that effect. http://www.codeproject.com/script/Membership/View.aspx?mid=2940943[^]

                    R Offline
                    R Offline
                    Rajesh R Subramanian
                    wrote on last edited by
                    #9

                    This is sad, but I understand how you are feeling. :(

                    It is a crappy thing, but it's life -^ Carlo Pallini

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups