Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

IShellIconOverlayIdentifier::GetOverlayInfo implementation Explorer.exe crashing

Posted on 2012-03-22
3
Medium Priority
?
989 Views
Last Modified: 2012-03-22
I have created a shell IconOverlayBaseImpl class which created an entry in the registry

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers

I have implemented  IShellIconOverlayIdentifier::GetOverlayInfo method as  a wrapper class
Wrapper:::GetOverlayInfo(LPWSTR pwszIconFile, int cchMax, int* pIndex, DWORD* pdwFlags)
{

*pdwFlags = ISIOI_ICONFILE | ISIOI_ICONINDEX;
*pIndex = 0; 
*pdwFlags = ISIOI_ICONFILE | ISIOI_ICONINDEX;
 wcsncpy_s(L"C:\\Users\\guest\\Desktop\\File\\Fox", 31, L"C:\\Test\\alert.ico, 31); 
return S_OK;

}

Wrapper::IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib )
{

	if(Obj.getVal("C:\\Users\\guest\\Desktop\\File\\Fox") //Bool
	{
		return S_OK;

	}

}


//IconOverlayBase::GetOverlayInfo will call shell Wrapper:GetOverlayInfo method.


IconOverlayBaseImpl::IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib )
{

          Hresult hr = Wrapper.IsMemberOf(pwszPath, dwAttrib);
        if(SUCCEEDED(hr) && hr == S_OK)
	{
          Wrapper:::GetOverlayInfo()
		
	}


}

Open in new window


But Explorer.exe is crashing  at   wcsncpy_s(L"C:\\Users\\guest\\Desktop\\File\\Fox", 31, L"C:\\Test\\alert.ico, 31);
0
Comment
Question by:HPFE455
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 37754354
Um, in the line

 wcsncpy_s(L"C:\\Users\\guest\\Desktop\\File\\Fox", 31, L"C:\\Test\\alert.ico, 31);

Open in new window


the fist parameter should be the target buffer, *not* a string literal, which causes the crash - did you mean

 wcsncpy_s(pwszIconFile, 31, L"C:\\Test\\alert.ico, 31);

Open in new window


?
0
 
LVL 86

Expert Comment

by:jkr
ID: 37754356
Ooops, sorry, that should be

 wcsncpy_s(pwszIconFile, cchMax, L"C:\\Test\\alert.ico, 31);

Open in new window

0
 

Author Comment

by:HPFE455
ID: 37755236
I was using wrognly, later I found.  thanks jkr
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

610 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