Move NATIVE_DLL_SEARCH_DIRECTORIES probing earlier right before we probe for absolute path and assembly path. This is needed to make sure servicing directories (set in NATIVE_DLL_SEARCH_DIRECTORIES by host) are honored correctly before everything else, along with rest of the NATIVE_DLL_SEARCH_DIRECTORIES probing path. In order to preserve compat with UWP host, I kept the rest of the interop probing logic even when NATIVE_DLL_SEARCH_DIRECTORIES probing path is specified. To my horror I discovered the fact that we actually never set hmod when loading DLL from NATIVE_DLL_SEARCH_DIRECTORIES probing, and the probably the only saving grace is that our ultimate fallback LoadLibrary call after that would "just work" and return the HMODULE we just loaded... This is now fixed.
Move NATIVE_DLL_SEARCH_DIRECTORIES probing earlier right before we probe for absolute path and assembly path. This is needed to make sure servicing directories (set in NATIVE_DLL_SEARCH_DIRECTORIES by host) are honored correctly before everything else, along with rest of the NATIVE_DLL_SEARCH_DIRECTORIES probing path. In order to preserve compat with UWP host, I kept the rest of the interop probing logic even when NATIVE_DLL_SEARCH_DIRECTORIES probing path is specified.
To my horror I discovered the fact that we actually never set hmod when loading DLL from NATIVE_DLL_SEARCH_DIRECTORIES probing, and the probably the only saving grace is that our ultimate fallback LoadLibrary call after that would "just work" and return the HMODULE we just loaded... This is now fixed.

James-Ko/coreclr,cydhaselton/coreclr,KrzysztofCwalina/coreclr,russellhadley/coreclr,schellap/coreclr,yeaicc/coreclr,LLITCHEV/coreclr,gkhanna79/coreclr,ragmani/coreclr,jhendrixMSFT/coreclr,James-Ko/coreclr,mskvortsov/coreclr,dpodder/coreclr,josteink/coreclr,ZhichengZhu/coreclr,JonHanna/coreclr,sjsinju/coreclr,Dmitry-Me/coreclr,mmitche/coreclr,mmitche/coreclr,sagood/coreclr,dasMulli/coreclr,dasMulli/coreclr,krytarowski/coreclr,shahid-pk/coreclr,wateret/coreclr,cmckinsey/coreclr,cmckinsey/coreclr,ruben-ayrapetyan/coreclr,hseok-oh/coreclr,sagood/coreclr,cmckinsey/coreclr,kyulee1/coreclr,shahid-pk/coreclr,wtgodbe/coreclr,James-Ko/coreclr,JonHanna/coreclr,yeaicc/coreclr,James-Ko/coreclr,AlexGhiondea/coreclr,dasMulli/coreclr,russellhadley/coreclr,ragmani/coreclr,cydhaselton/coreclr,vinnyrom/coreclr,yeaicc/coreclr,josteink/coreclr,wtgodbe/coreclr,pgavlin/coreclr,bartdesmet/coreclr,Dmitry-Me/coreclr,cshung/coreclr,mmitche/coreclr,jamesqo/coreclr,vinnyrom/coreclr,tijoytom/coreclr,qiudesong/coreclr,KrzysztofCwalina/coreclr,YongseopKim/coreclr,russellhadley/coreclr,manu-silicon/coreclr,manu-silicon/coreclr,ZhichengZhu/coreclr,parjong/coreclr,JosephTremoulet/coreclr,roncain/coreclr,JonHanna/coreclr,roncain/coreclr,qiudesong/coreclr,jamesqo/coreclr,ragmani/coreclr,josteink/coreclr,cydhaselton/coreclr,ruben-ayrapetyan/coreclr,parjong/coreclr,parjong/coreclr,roncain/coreclr,roncain/coreclr,sjsinju/coreclr,josteink/coreclr,botaberg/coreclr,kyulee1/coreclr,KrzysztofCwalina/coreclr,vinnyrom/coreclr,alexperovich/coreclr,KrzysztofCwalina/coreclr,vinnyrom/coreclr,josteink/coreclr,hseok-oh/coreclr,naamunds/coreclr,jhendrixMSFT/coreclr,dpodder/coreclr,hseok-oh/coreclr,krk/coreclr,kyulee1/coreclr,yizhang82/coreclr,krk/coreclr,cydhaselton/coreclr,JosephTremoulet/coreclr,ruben-ayrapetyan/coreclr,alexperovich/coreclr,cshung/coreclr,sjsinju/coreclr,jhendrixMSFT/coreclr,schellap/coreclr,alexperovich/coreclr,ramarag/coreclr,bartdesmet/coreclr,poizan42/coreclr,manu-silicon/coreclr,AlexGhiondea/coreclr,Dmitry-Me/coreclr,wtgodbe/coreclr,dasMulli/coreclr,dasMulli/coreclr,parjong/coreclr,sjsinju/coreclr,JosephTremoulet/coreclr,schellap/coreclr,dasMulli/coreclr,krytarowski/coreclr,rartemev/coreclr,bartdesmet/coreclr,qiudesong/coreclr,poizan42/coreclr,martinwoodward/coreclr,krytarowski/coreclr,dpodder/coreclr,ragmani/coreclr,wateret/coreclr,mskvortsov/coreclr,wtgodbe/coreclr,mskvortsov/coreclr,Dmitry-Me/coreclr,schellap/coreclr,yeaicc/coreclr,ruben-ayrapetyan/coreclr,dpodder/coreclr,James-Ko/coreclr,botaberg/coreclr,roncain/coreclr,yeaicc/coreclr,sagood/coreclr,tijoytom/coreclr,jhendrixMSFT/coreclr,jamesqo/coreclr,alexperovich/coreclr,yizhang82/coreclr,dasMulli/coreclr,roncain/coreclr,naamunds/coreclr,JonHanna/coreclr,naamunds/coreclr,mskvortsov/coreclr,schellap/coreclr,josteink/coreclr,LLITCHEV/coreclr,LLITCHEV/coreclr,cydhaselton/coreclr,mmitche/coreclr,russellhadley/coreclr,tijoytom/coreclr,wateret/coreclr,yizhang82/coreclr,russellhadley/coreclr,mskvortsov/coreclr,botaberg/coreclr,manu-silicon/coreclr,sjsinju/coreclr,cshung/coreclr,AlexGhiondea/coreclr,yizhang82/coreclr,ramarag/coreclr,krk/coreclr,yizhang82/coreclr,sagood/coreclr,neurospeech/coreclr,cshung/coreclr,cmckinsey/coreclr,mmitche/coreclr,AlexGhiondea/coreclr,Dmitry-Me/coreclr,parjong/coreclr,jhendrixMSFT/coreclr,krytarowski/coreclr,hseok-oh/coreclr,wateret/coreclr,kyulee1/coreclr,ZhichengZhu/coreclr,ZhichengZhu/coreclr,poizan42/coreclr,cshung/coreclr,gkhanna79/coreclr,bartdesmet/coreclr,qiudesong/coreclr,wateret/coreclr,sagood/coreclr,YongseopKim/coreclr,LLITCHEV/coreclr,AlexGhiondea/coreclr,YongseopKim/coreclr,gkhanna79/coreclr,dpodder/coreclr,YongseopKim/coreclr,yeaicc/coreclr,pgavlin/coreclr,bartdesmet/coreclr,bartdesmet/coreclr,yizhang82/coreclr,poizan42/coreclr,alexperovich/coreclr,hseok-oh/coreclr,botaberg/coreclr,martinwoodward/coreclr,Dmitry-Me/coreclr,martinwoodward/coreclr,neurospeech/coreclr,wtgodbe/coreclr,JonHanna/coreclr,naamunds/coreclr,neurospeech/coreclr,AlexGhiondea/coreclr,pgavlin/coreclr,shahid-pk/coreclr,krk/coreclr,mskvortsov/coreclr,vinnyrom/coreclr,cmckinsey/coreclr,jhendrixMSFT/coreclr,krk/coreclr,ramarag/coreclr,vinnyrom/coreclr,bartdesmet/coreclr,pgavlin/coreclr,tijoytom/coreclr,naamunds/coreclr,KrzysztofCwalina/coreclr,parjong/coreclr,qiudesong/coreclr,JosephTremoulet/coreclr,sjsinju/coreclr,rartemev/coreclr,cshung/coreclr,martinwoodward/coreclr,ramarag/coreclr,JosephTremoulet/coreclr,ZhichengZhu/coreclr,yeaicc/coreclr,schellap/coreclr,qiudesong/coreclr,hseok-oh/coreclr,JosephTremoulet/coreclr,James-Ko/coreclr,rartemev/coreclr,sagood/coreclr,manu-silicon/coreclr,rartemev/coreclr,ramarag/coreclr,rartemev/coreclr,shahid-pk/coreclr,cydhaselton/coreclr,cmckinsey/coreclr,ruben-ayrapetyan/coreclr,jamesqo/coreclr,LLITCHEV/coreclr,neurospeech/coreclr,pgavlin/coreclr,ZhichengZhu/coreclr,ZhichengZhu/coreclr,tijoytom/coreclr,tijoytom/coreclr,gkhanna79/coreclr,ruben-ayrapetyan/coreclr,cmckinsey/coreclr,YongseopKim/coreclr,josteink/coreclr,manu-silicon/coreclr,wtgodbe/coreclr,poizan42/coreclr,KrzysztofCwalina/coreclr,botaberg/coreclr,LLITCHEV/coreclr,jamesqo/coreclr,poizan42/coreclr,neurospeech/coreclr,russellhadley/coreclr,martinwoodward/coreclr,jhendrixMSFT/coreclr,mmitche/coreclr,alexperovich/coreclr,gkhanna79/coreclr,ramarag/coreclr,gkhanna79/coreclr,ragmani/coreclr,krk/coreclr,shahid-pk/coreclr,martinwoodward/coreclr,krytarowski/coreclr,ramarag/coreclr,kyulee1/coreclr,ragmani/coreclr,wateret/coreclr,shahid-pk/coreclr,neurospeech/coreclr,kyulee1/coreclr,naamunds/coreclr,naamunds/coreclr,YongseopKim/coreclr,JonHanna/coreclr,botaberg/coreclr,manu-silicon/coreclr,LLITCHEV/coreclr,schellap/coreclr,vinnyrom/coreclr,jamesqo/coreclr,pgavlin/coreclr,martinwoodward/coreclr,dpodder/coreclr,krytarowski/coreclr,roncain/coreclr,KrzysztofCwalina/coreclr,shahid-pk/coreclr,Dmitry-Me/coreclr,rartemev/coreclr