When is function driver of a statically enumerated device loaded?

When is function driver of a statically enumerated device loaded?
The discussion below applies only to KMDF drivers for Windows Phone8.1
I'm studying a sample driver package with a software-only bus driver(sample_bus.sys, whose start type is SERVICE_SYSTEM_START (0x01)) and one statically enumerated child driver(sample_child.sys, whose start type is SERVICE_DEMAND_START (0x3)).
In the bus driver, a PDO for the child device is created. But I cannot figure out when the function driver(sample_child.sys) for the child device is loaded(I guess the funcion driver for the child device is loaded by PNP)
So the question is: which function(s) below "trigger" the loading of function driver of child device(sample_child.sys)?
Follwing is sample code of the bus driver(sample_bus.sys); error checking code is removed for simplicity
deviceInit = WdfPdoInitAllocate( device );status = WdfPdoInitAssignDeviceID( deviceInit, &str); //Device IDstatus = WdfPdoInitAddHardwareID( deviceInit, &str ); //Hardware IDWDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE( &pdoAttributes, SAMPLE_DRIVER_DATA );pdoAttributes.EvtCleanupCallback = SampleDriverFdoCleanupChildDevice;pdoAttributes.SynchronizationScope = WdfSynchronizationScopeDevice;status = WdfDeviceInitRegisterPnpStateChangeCallback( deviceInit, WdfDevStatePnpStarted, SampleBusFdoChildStarted, StateNotificationEnterState );status = WdfDeviceCreate( &deviceInit, &pdoAttributes, &childDevice );status = WdfFdoAddStaticChild( device, childDevice );

If you think about this the driver for the PDO is loaded in response to the system learning that there is a new PDO in the stack.  Given that it is WdfFdoAddStaticChild that will trigger the load.
Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com

Similar Messages

  • Dv2915nr cd/dvd drive doesn't recognize when disk in. drive doesnt show up in device manager.

    dv2915nr cd/dvd drive doesn't recognize when disk in. drive doesnt show up in device manager.

    Hi,
    Here's one option you could try as it will give a good indication whether the problem is with Windows or a Hardware issue with the optical drive itself. 
    Create a bootable Ubuntu CD
    The Ubuntu CD you create should run as you boot the notebook ( ie outside of Windows operating system ), so if this will not run, the problem is almost certainly a Hardware issue with the DVD drive
    On another PC, follow the procedure on the link below to create a bootable Ubuntu CD and follow the steps in Part 3 to 'Try it' to see if this OS will run from the CD.  The 'try it' option does not need to install on the Hard Drive, it just runs from the CD.
    http://www.ubuntu.com/desktop/get-ubuntu/download
    Let me know if this will run.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • I have checked around the internet, but still can't find any answers. How can I prevent incoming mail from interrupting the music I am listening to on my iPhone? That 1-second muting function drives me insane, especially when a lot of mail is coming in.

    I have checked around the internet, but still can't find any answers. How can I prevent incoming mail from interrupting the music I am listening to on my iPhone? That 1-second muting function drives me insane, especially when a lot of mail is coming in.

    If you want to hear your music on iPhone without interruption, switch Settings > Airplane Mode: ON.

  • A function driver was not specified

    I cannot see my iPod in My Computer or iTunes. I get the message "The installation failed because a function driver was not specified for this device instance." when I re-boot after the iPod CD installation.
      Windows 2000  

    This maybe of help.
    USB drivers are not installed properly.

  • When I attempt to open iphoto, I get the loading icon in the working space/picture area.  If I try to reinstall ilife '11, will I lose any pictures?  Where, on the hard drive, are all my pictures actually stored?

    When I attempt to open iphoto, I get the loading icon in the working space/picture area.  If I try to reinstall ilife '11, will I lose any pictures?  Where, on the hard drive, are all my pictures actually stored?

    You won't lose anything because you have a back up, right?
    Most Simple Back Up
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex:
    Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically. Examples of such apps: Chronosync or DejaVu . But are many others. Search on MacUpdate
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • How can I send an email when a function returns false?

    Im trying to make this code work, but i still receive an email when the function is equal to false. Can anyone assist me in finding the issue? What the program does is look for servers that has a set limit (in GB) on specific drives.
    #This Program goes through all the servers and informs any level below the limit
    $ErrorActionPreference = "SilentlyContinue";
    $scriptpath = $MyInvocation.MyCommand.Definition
    $dir = Split-Path $scriptpath
    #=================Function============
    Function isLow($server, $drive, $limit)
    $disk = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3 and DeviceID = '$drive'";
    [float]$size = $disk.Capacity;
    [float]$freespace = $disk.FreeSpace;
    $sizeGB = [Math]::Round($size / 1073741824, 2);
    $freeSpaceGB = [Math]::Round($freespace / 1073741824, 2);
    if($freeSpaceGB -lt $limit){
    return $true;
    else{
    return $false;
    #================Servers==============
    #------------------###server1--------------
    $server = "###server1";
    $drive = "C:";
    $lim = 25;
    if(isLow $server $drive $lim)
    $Alert += $server + " || " + $drive + " is low<br>"
    $server = "###server1";
    $drive = "D:";
    $lim = 35;
    if(isLow $server $drive $lim)
    $Alert += $server + " || " + $drive + " is low<br>"
    #-----------------###(more servers ect.)--------------
    #================EMAIL===============
    $smtpServer = "192.168.x.x"
    $ReportSender = "[email protected]"
    $users = "[email protected]"
    $MailSubject = "ALERT!!! Low DiskSpace"
    foreach($user in $users){
    if($true){
    Write-Host "Sending Email notification to $user"
    $smtp = New-Object Net.Mail.SmtpClient($smtpServer)
    $msg = New-Object Net.Mail.MailMessage
    $msg.To.Add($user)
    $msg.From = $ReportSender
    $msg.Subject = $MailSubject
    $msg.IsBodyHTML = $True
    $msg.Body = $Alert
    $smtp.Send($msg)
    else($false){
    Write-Host "No one is pass the limit"

    Using a CSV is good.  Just load the "$servers" hash array from a CSV and the rest will work the same. The overall structure would work better if it was more like this.
    Function isLow($server, $drive, $limit){
    $disk = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk -Filter "DriveType = 3 and DeviceID = '$drive'"
    if($disk.FreeSSpace -lt $limit){
    $true
    }else{
    $false
    $servers=@()
    $servers=@{
    Server="###server1"
    Drive='C:'
    Limit=25Gb
    $servers=@{
    Server="###server2"
    Drive='D:'
    Limit=15Gb
    $servers=@{
    Server="###server3"
    Drive='C:'
    Limit=50Gb
    $results=foreach($servers in $servers){
    if(isLow $server.Server $server.Drive $server.Limit){
    '{0} || {1} is low<br>' -f $servers.Server,$server.Drive
    if($results){
    Write-Host 'Sending Email notification' -fore green
    $mailprops=@{
    SmtpServer='192.168.x.x'
    From='[email protected]'
    To=$users
    Subject='ALERT!!! Low DiskSpace'
    Body=$results
    BodyAsHtml=$true
    Send-MailMessage @mailprops
    }else{
    Write-Host 'No one is past the limit' -ForegroundColor green
    The biggest issue is to realize that this is a computer.  If you type the same thing more than once then consider that the computer can do it for you.  Once you learn to think like a computer all of this becomes easier.
    ¯\_(ツ)_/¯

  • When I backed up files on my external drive, I inadvertently dragged my itunes library there. Now I can only play songs on my laptop when my external drive is plugged in. How do I get the library back to my computer

    When I was backing up files from my computer to my external drive, I inadvertently dragged my itunes library to the external drive. Now I can only play my library when my external drive is plugged into my computer. How do I get the library location changed back to my computer?

    Your drive was used with a PC and formatted NTFS which is proprietary Microsoft format.
    You need to install a third party program that will read the NTFS format.
    There is various software from PARAGON, Tuxera and NTFS-3G
    When you get the data off and have verified it to be good, reformat the drive either HFS+ for Mac use only, or for Mac and PC use then MSDOS (FAT32) for under 4GB files (best) or exFAT (for larger than 4GB files) is proprietary and Microsoft is appling for a patent, which would likely mean OS X won't be allowed to read it anymore without a licensing fee and you'l have to pay another third party software company to read the format, just like NTFS is.
    The less you have to rely upon third party sources to read your drives the better, this way if you have a issue and need to read the drive on another machine you don't need the software, and a internet connection and a credit card and...and...and...

  • I lost my iTunes library on my pc when the hard drive crashed. None of the data on the drive was recoverable and I did not have a backup. How can I get the music that resides on my ipod nano (4th generation back onto the new hard drive on my pc.

    I lost my iTunes library on my pc when the hard drive crashed. None of the data on the drive was recoverable and I did not have a backup either locally or on the cloud. Much of the music is from old vinyl and podcasts which are no longer available.
    How can I get the music that resides on my ipod nano (4th generation) back onto the new hard drive on my pc.
    I have been reluctant to install iTunes on the new hard drive out of fear that I will lose all the contents on the ipod if I try to synch to the new hard drive.
    Help!

    No backup is a huge mistake.
    You can redownload some itunes purchases in some countries:
    Downloading past purchases from the App Store ... - Apple - Support

  • When my hard drive died I lost my itunes library and now I'm being told that I can't synch my ipod with new songs unless I delete all existing because I can only have one library at a time

    when my hard drive died I lost my itunes library and now I'm being told that I can't synch my ipod with new songs unless I delete all existing because I can only have one library at a time

    Copy all the content on your iPod back to your PC and into iTunes. Then go ahead and sync the iPod with your new library.
    See this older post from another forum member Zevoneer covering the different methods and software available to assist you with the task of copying content from your iPod back to your PC and into iTunes.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

  • I lost all my purchased songs when my hard drive.  Can I get another copy from Apple?

    I lost all my purchased songs when my hard drive.  Can I get another copy from Apple?

    Quite possibly, at least assuming you are based in the US. Install the latest build of iTunes, sign into the iTunes Store and click the Purchased entry in the Quck Links panel. Here in the UK I only get tabs fro Apps and Books but, if I understand correctly, you should also get a tab for Music. Click on the Not in My Library button and you should be able to download your purchases again.
    tt2

  • HT1660 I lost my entire music library when my hard drive crashed 2 wks ago. It's all on my iPod, though. I just cannot figure out how to download my iPod music BACK into my iTunes library. All they seems to address is Library - iPod.  I'm not an iT geek..

    Hi, I lost my entire music library when my hard drive crashed 2 wks ago. It's all on my iPod, though..but the songlist appears gray.  I just cannot figure out how to download my iPod music list BACK into my iTunes library. All they seems to address is Library -> iPod transfers.  I'm not an iT geek.. Help meeee!

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • ?When your hard drive crashes

    I had about 400 compact discs and a few itunes worth of music on my itunes when my hard drive crashed.
    My music is still on my ipod but it seems if I put anything on my new itunes folder on my new hard drive, I'll lose my old music when I sync.
    Is this correct?
    I'd appreciate any help on how to live with this lost data on my hard drive.
    Message was edited by: acb3
    Message was edited by: acb3

    Hi. Welcome to the forums.
    Yes, Your new install will want to overwrite the iPod with a blank library given half a chance. Check out this post from Zevoneer for some iPod recovery options.
    http://discussions.apple.com/thread.jspa?messageID=6273675&#6273675
    Should explain how you can drag your music back from the iPod. I've used the manual method successfully in the past. Some of the other tools can take a long time to catalogue the iPod so be patient.
    tt2

  • MacBook Doesn't Wake Up (when External FireWire Drives attached)

    Anybody else notice their MacBook not waking up from sleep when Fire Wire drives are attached, specifically through the FW port or the Express Card port.
    Granted, the MacBook wakes up 50% of the time in general with nothing attached...kind of a crap shoot.

    Hi, I have a macbook air for some time now. It works fine, starts reasonable fast and with one exception I'm pleased with it.If I closed the LID or press the on-off button the system sleeps. When I open the lid the next day (8 -12 hrs later) the system doesn't wake up. The log file which I presume is send to Apple did lead to a patch. I saw on the support site various conversations in respect to this issue with various results.
    I see that the problem of James even returned and was not reported to be resolved until now.
    In my log I have the following messages, "Sleep failure" of last few days. What should I do to resolve this, or is Apple delivering a patch for this?
    <Start log copy>
    17-09-14 03:14:01,755 powerd[16]: com.apple.message.domain: com.apple.sleep.failure
    com.apple.message.signature: Capability Failure
    com.apple.message.summarize: YES
    Sender_Mach_UUID: 83C854AA-0FB9-30C2-8443-D10D781E0E25
    17-09-14 09:24:37,960 powerd[16]: com.apple.message.domain: com.apple.sleep.failure
    com.apple.message.signature: Platform Failure
    com.apple.message.summarize: YES
    Sender_Mach_UUID: 83C854AA-0FB9-30C2-8443-D10D781E0E25
    20-09-14 03:31:14,288 powerd[16]: com.apple.message.domain: com.apple.sleep.failure
    com.apple.message.signature: Capability Failure
    com.apple.message.summarize: YES
    Sender_Mach_UUID: 83C854AA-0FB9-30C2-8443-D10D781E0E25
    20-09-14 09:56:41,453 powerd[16]: com.apple.message.domain: com.apple.sleep.failure
    com.apple.message.signature: Platform Failure
    com.apple.message.summarize: YES
    Sender_Mach_UUID: 83C854AA-0FB9-30C2-8443-D10D781E0E25
    <end log copy>
    regards, Roderick.

  • Problem when calling function module CV120_DOC_CHECKOUT_VIEW in background

    Hi ,
    I'm currently developping an abap program which extract document from KPRO for printing into a windows Folder.
    For this I use standard function module CV120_DOC_CHECKOUT_VIEW.
    When i run my program in foreground task there's no problem, but when i run it in background task the extract doesn't work. It seems that the system cannot connect to the Windows Network.
    Whe the program is running in foreground task, the function module user SAPHHTP RFC destination, when it runs in background task it use SAPFTP destination .
    Does somebody can help me ?
    thanks in advance

    Hi Ajay,
    The program extract document into a folder on Windows Network that means on a server not on a PC .
    I know that in background task ther's no connection with sapgui.
    For example when i want to create a file on network n background task i use OPEN_DATASET instruction and that works fine.
    My problem is the use of the standard function module CV120_DOC_CHECKOUT_VIEW in background task because when this function module is running in background task it use the SAPFTP rfc destination instead of SAPHHTP rfc destination in foreground task . I check the RFC destination , thoses works both . SO i think the problem comes from parameters given to the function module.
    Regards.

  • I was loading some CDs into my iTunes library when the disk drive refused to "suck in" the next CD.  Does anyone have a suggest on how I might proceed?

    I was loading some CDs into my iTunes library when the disk drive refused to "suck in" the next CD.  Does anyone have a suggest on how I might proceed?

    Yes, that is a Catch 22.  If you have another Mac you can connect your Mac to it in the Target Disk Mode,  Transferring files between two computers using FireWire, and use Disk Utility on the second Mac to try to run the Hardware Test from there.  Not sure if it's possible to a connected Mac though.
    You can try this several times in the Terminal app and then see if a disk can be fully inserted:
    Enter the following command followed by the Enter or Return key:
    drutil eject
    Do it several times and then try another disk.  (A long shot).

Maybe you are looking for