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. mciSendString from inside a DLL?

mciSendString from inside a DLL?

Scheduled Pinned Locked Moved C / C++ / MFC
data-structurestestingbeta-testingquestion
4 Posts 2 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.
  • H Offline
    H Offline
    hxhl95
    wrote on last edited by
    #1

    Not quite sure where I should ask this...I mean, this site really needs a Windows programming section, doesn't it? Anyways, here goes. I have this DLL trying to call mciSendString (command passed as a parameter). The call works fine in an EXE, but it refuses to do anything on a DLL (I'm testing with "set cdaudio door open"). The function gets called but it hangs. Forever. Stack, if it helps:

    ntkrnlpa.exe!ExAllocatePoolWithTag+0x8ab
    ntkrnlpa.exe!MmIsDriverVerifying+0xa08
    ntkrnlpa.exe!MmIsDriverVerifying+0x12ea
    ntkrnlpa.exe!PoShutdownBugCheck+0x32ce
    ntkrnlpa.exe!KeSynchronizeExecution+0x10c
    ntdll.dll!KiFastSystemCallRet
    !WaitForSingleObject+0x12
    !waveOutWrite+0x50c
    !mci32Message+0x526
    !mciSendCommandW+0x10b
    !mciSendCommandW+0x48e
    !mciSendStringW+0x31
    !mciSendStringA+0x87

    Thanks! :)

    E 1 Reply Last reply
    0
    • H hxhl95

      Not quite sure where I should ask this...I mean, this site really needs a Windows programming section, doesn't it? Anyways, here goes. I have this DLL trying to call mciSendString (command passed as a parameter). The call works fine in an EXE, but it refuses to do anything on a DLL (I'm testing with "set cdaudio door open"). The function gets called but it hangs. Forever. Stack, if it helps:

      ntkrnlpa.exe!ExAllocatePoolWithTag+0x8ab
      ntkrnlpa.exe!MmIsDriverVerifying+0xa08
      ntkrnlpa.exe!MmIsDriverVerifying+0x12ea
      ntkrnlpa.exe!PoShutdownBugCheck+0x32ce
      ntkrnlpa.exe!KeSynchronizeExecution+0x10c
      ntdll.dll!KiFastSystemCallRet
      !WaitForSingleObject+0x12
      !waveOutWrite+0x50c
      !mci32Message+0x526
      !mciSendCommandW+0x10b
      !mciSendCommandW+0x48e
      !mciSendStringW+0x31
      !mciSendStringA+0x87

      Thanks! :)

      E Offline
      E Offline
      Eugen Podsypalnikov
      wrote on last edited by
      #2

      It seems to be a "deadlock"... :) (for example, a recursion on the code block, what is protected by a critical section... ...like: mciSendCommand(..)->mciSendString(..)->mciSendCommand(..))

      virtual void BeHappy() = 0;

      H 1 Reply Last reply
      0
      • E Eugen Podsypalnikov

        It seems to be a "deadlock"... :) (for example, a recursion on the code block, what is protected by a critical section... ...like: mciSendCommand(..)->mciSendString(..)->mciSendCommand(..))

        virtual void BeHappy() = 0;

        H Offline
        H Offline
        hxhl95
        wrote on last edited by
        #3

        So why does it work from an EXE but not a DLL? And what should I do to fix it? :confused:

        E 1 Reply Last reply
        0
        • H hxhl95

          So why does it work from an EXE but not a DLL? And what should I do to fix it? :confused:

          E Offline
          E Offline
          Eugen Podsypalnikov
          wrote on last edited by
          #4

          May be the analyzing of the stack before the call will help... :)

          virtual void BeHappy() = 0;

          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