diff options
-rw-r--r-- | utils/MTP/MTP_DLL/MTP_DLL.cpp | 41 | ||||
-rw-r--r-- | utils/MTP/MTP_DLL/MTP_DLL.h | 25 | ||||
-rw-r--r-- | utils/MTP/MTP_DLL/MTP_DLL.sln | 20 | ||||
-rwxr-xr-x | utils/MTP/MTP_DLL/README | 67 | ||||
-rw-r--r-- | utils/MTP/MTP_DLL/sendfirm_win.cpp | 29 | ||||
-rw-r--r-- | utils/MTP/MTP_DLL/stdafx.cpp | 13 | ||||
-rw-r--r-- | utils/MTP/MTP_DLL/stdafx.h | 54 |
7 files changed, 150 insertions, 99 deletions
diff --git a/utils/MTP/MTP_DLL/MTP_DLL.cpp b/utils/MTP/MTP_DLL/MTP_DLL.cpp index ffd314a697..73085afaee 100644 --- a/utils/MTP/MTP_DLL/MTP_DLL.cpp +++ b/utils/MTP/MTP_DLL/MTP_DLL.cpp | |||
@@ -1,22 +1,21 @@ | |||
1 | // MTP_DLL.cpp : Defines the entry point for the DLL application. | 1 | /* MTP_DLL.cpp : Defines the entry point for the DLL application. */ |
2 | // | 2 | |
3 | 3 | #include "stdafx.h" | |
4 | #include "stdafx.h" | 4 | #include "MTP_DLL.h" |
5 | #include "MTP_DLL.h" | 5 | |
6 | 6 | ||
7 | 7 | #ifdef _MANAGED | |
8 | #ifdef _MANAGED | 8 | #pragma managed(push, off) |
9 | #pragma managed(push, off) | 9 | #endif |
10 | #endif | 10 | |
11 | 11 | BOOL APIENTRY DllMain( HMODULE hModule, | |
12 | BOOL APIENTRY DllMain( HMODULE hModule, | 12 | DWORD ul_reason_for_call, |
13 | DWORD ul_reason_for_call, | 13 | LPVOID lpReserved |
14 | LPVOID lpReserved | 14 | ) |
15 | ) | 15 | { |
16 | { | 16 | return TRUE; |
17 | return TRUE; | 17 | } |
18 | } | 18 | |
19 | 19 | #ifdef _MANAGED | |
20 | #ifdef _MANAGED | 20 | #pragma managed(pop) |
21 | #pragma managed(pop) | ||
22 | #endif \ No newline at end of file | 21 | #endif \ No newline at end of file |
diff --git a/utils/MTP/MTP_DLL/MTP_DLL.h b/utils/MTP/MTP_DLL/MTP_DLL.h index ad99014bc2..eeee72a87b 100644 --- a/utils/MTP/MTP_DLL/MTP_DLL.h +++ b/utils/MTP/MTP_DLL/MTP_DLL.h | |||
@@ -1,17 +1,10 @@ | |||
1 | // The following ifdef block is the standard way of creating macros which make exporting | 1 | #ifdef MTP_DLL_EXPORTS |
2 | // from a DLL simpler. All files within this DLL are compiled with the MTP_DLL_EXPORTS | 2 | #define MTP_DLL_API __declspec(dllexport) |
3 | // symbol defined on the command line. this symbol should not be defined on any project | 3 | #else |
4 | // that uses this DLL. This way any other project whose source files include this file see | 4 | #define MTP_DLL_API __declspec(dllimport) |
5 | // MTP_DLL_API functions as being imported from a DLL, whereas this DLL sees symbols | 5 | #endif |
6 | // defined with this macro as being exported. | ||
7 | #ifdef MTP_DLL_EXPORTS | ||
8 | #define MTP_DLL_API __declspec(dllexport) | ||
9 | #else | ||
10 | #define MTP_DLL_API __declspec(dllimport) | ||
11 | #endif | ||
12 | |||
13 | extern "C" | ||
14 | { | ||
15 | __declspec(dllexport) bool send_fw(LPWSTR file, int filesize, void (*callback)(unsigned int progress, unsigned int max)); | ||
16 | } | ||
17 | 6 | ||
7 | extern "C" | ||
8 | { | ||
9 | __declspec(dllexport) bool send_fw(LPWSTR file, int filesize, void (*callback)(unsigned int progress, unsigned int max)); | ||
10 | } | ||
diff --git a/utils/MTP/MTP_DLL/MTP_DLL.sln b/utils/MTP/MTP_DLL/MTP_DLL.sln deleted file mode 100644 index bcd56174f5..0000000000 --- a/utils/MTP/MTP_DLL/MTP_DLL.sln +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | | ||
2 | Microsoft Visual Studio Solution File, Format Version 9.00 | ||
3 | # Visual Studio 2005 | ||
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MTP_DLL", "MTP_DLL.vcproj", "{C7A39A2D-2ADF-40A3-A9A5-0DF4509B761B}" | ||
5 | EndProject | ||
6 | Global | ||
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
8 | Debug|Win32 = Debug|Win32 | ||
9 | Release|Win32 = Release|Win32 | ||
10 | EndGlobalSection | ||
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
12 | {C7A39A2D-2ADF-40A3-A9A5-0DF4509B761B}.Debug|Win32.ActiveCfg = Debug|Win32 | ||
13 | {C7A39A2D-2ADF-40A3-A9A5-0DF4509B761B}.Debug|Win32.Build.0 = Debug|Win32 | ||
14 | {C7A39A2D-2ADF-40A3-A9A5-0DF4509B761B}.Release|Win32.ActiveCfg = Release|Win32 | ||
15 | {C7A39A2D-2ADF-40A3-A9A5-0DF4509B761B}.Release|Win32.Build.0 = Release|Win32 | ||
16 | EndGlobalSection | ||
17 | GlobalSection(SolutionProperties) = preSolution | ||
18 | HideSolutionNode = FALSE | ||
19 | EndGlobalSection | ||
20 | EndGlobal | ||
diff --git a/utils/MTP/MTP_DLL/README b/utils/MTP/MTP_DLL/README new file mode 100755 index 0000000000..b256aae304 --- /dev/null +++ b/utils/MTP/MTP_DLL/README | |||
@@ -0,0 +1,67 @@ | |||
1 | Windows MTP Firmware Uploading Implementation | ||
2 | ============================================= | ||
3 | |||
4 | This code is based on http://opensource.creative.com/mtp_xfer.html and was | ||
5 | edited by Maurus Cuelenaere for the Rockbox project. | ||
6 | |||
7 | It is released under the BSD license: | ||
8 | |||
9 | Copyright (c) 2009, Maurus Cuelenaere | ||
10 | All rights reserved. | ||
11 | |||
12 | Redistribution and use in source and binary forms, with or without | ||
13 | modification, are permitted provided that the following conditions are met: | ||
14 | * Redistributions of source code must retain the above copyright | ||
15 | notice, this list of conditions and the following disclaimer. | ||
16 | * Redistributions in binary form must reproduce the above copyright | ||
17 | notice, this list of conditions and the following disclaimer in the | ||
18 | documentation and/or other materials provided with the distribution. | ||
19 | * Neither the name of the <organization> nor the | ||
20 | names of its contributors may be used to endorse or promote products | ||
21 | derived from this software without specific prior written permission. | ||
22 | |||
23 | THIS SOFTWARE IS PROVIDED BY MAURUS CUELENAERE ''AS IS'' AND ANY | ||
24 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
25 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
26 | DISCLAIMED. IN NO EVENT SHALL MAURUS CUELENAERE BE LIABLE FOR ANY | ||
27 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
28 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
30 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | |||
34 | |||
35 | Based on these mails from devsupport AT creativelabs DOT com, the original code | ||
36 | is believed to be in the Public Domain: | ||
37 | |||
38 | |||
39 | From: CLI Developer Support <devsupport AT creativelabs DOT com> | ||
40 | Sender: Ian Minett | ||
41 | Date: Wed, 18 Feb 2009 17:34:14 -0800 | ||
42 | >Hi, | ||
43 | > | ||
44 | >The code found at http://connect.creativelabs.com/opensource/ is open | ||
45 | >and made freely available on the connect site for use by developers | ||
46 | >such as yourself. You are welcome to use the code as you like. | ||
47 | > | ||
48 | >If you need to know the specific license it is released under, I'm afraid | ||
49 | > I will have to chase it up since I don't believe that site is being | ||
50 | > maintained anymore. | ||
51 | > | ||
52 | >Hope that helps, | ||
53 | >Ian | ||
54 | |||
55 | |||
56 | From: CLI Developer Support <devsupport AT creativelabs DOT com> | ||
57 | Sender: Daniel PEACOCK | ||
58 | Date: Thu, 19 Feb 2009 14:08:39 +0000 | ||
59 | >Hi, | ||
60 | > | ||
61 | >The MTP transfer example code is free to use for any purpose - commercial or otherwise. | ||
62 | >You can include it, or a variant of it, in your open-source project. | ||
63 | > | ||
64 | >Thanks for asking, | ||
65 | > | ||
66 | >Dan | ||
67 | >Creative Labs, UK \ No newline at end of file | ||
diff --git a/utils/MTP/MTP_DLL/sendfirm_win.cpp b/utils/MTP/MTP_DLL/sendfirm_win.cpp index 0861b345b0..6f9cf24e93 100644 --- a/utils/MTP/MTP_DLL/sendfirm_win.cpp +++ b/utils/MTP/MTP_DLL/sendfirm_win.cpp | |||
@@ -1,8 +1,33 @@ | |||
1 | /* Windows MTP Firmware Uploading Implementation | 1 | /* |
2 | * Windows MTP Firmware Uploading Implementation | ||
2 | * | 3 | * |
3 | * Based on http://opensource.creative.com/mtp_xfer.html | 4 | * Based on http://opensource.creative.com/mtp_xfer.html |
4 | * | ||
5 | * Edited by Maurus Cuelenaere for Rockbox | 5 | * Edited by Maurus Cuelenaere for Rockbox |
6 | * | ||
7 | * Copyright (c) 2009, Maurus Cuelenaere | ||
8 | * All rights reserved. | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or without | ||
11 | * modification, are permitted provided that the following conditions are met: | ||
12 | * * Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * * Redistributions in binary form must reproduce the above copyright | ||
15 | * notice, this list of conditions and the following disclaimer in the | ||
16 | * documentation and/or other materials provided with the distribution. | ||
17 | * * Neither the name of the <organization> nor the | ||
18 | * names of its contributors may be used to endorse or promote products | ||
19 | * derived from this software without specific prior written permission. | ||
20 | * | ||
21 | * THIS SOFTWARE IS PROVIDED BY MAURUS CUELENAERE ''AS IS'' AND ANY | ||
22 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
24 | * DISCLAIMED. IN NO EVENT SHALL MAURUS CUELENAERE BE LIABLE FOR ANY | ||
25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
6 | */ | 31 | */ |
7 | 32 | ||
8 | #include <windows.h> | 33 | #include <windows.h> |
diff --git a/utils/MTP/MTP_DLL/stdafx.cpp b/utils/MTP/MTP_DLL/stdafx.cpp index 68ee952ff4..c603f4f2c7 100644 --- a/utils/MTP/MTP_DLL/stdafx.cpp +++ b/utils/MTP/MTP_DLL/stdafx.cpp | |||
@@ -1,8 +1,5 @@ | |||
1 | // stdafx.cpp : source file that includes just the standard includes | 1 | /* stdafx.cpp : source file that includes just the standard includes |
2 | // MTP_DLL.pch will be the pre-compiled header | 2 | MTP_DLL.pch will be the pre-compiled header |
3 | // stdafx.obj will contain the pre-compiled type information | 3 | stdafx.obj will contain the pre-compiled type information */ |
4 | 4 | ||
5 | #include "stdafx.h" | 5 | #include "stdafx.h" |
6 | |||
7 | // TODO: reference any additional headers you need in STDAFX.H | ||
8 | // and not in this file | ||
diff --git a/utils/MTP/MTP_DLL/stdafx.h b/utils/MTP/MTP_DLL/stdafx.h index 1734058361..dc8d61f531 100644 --- a/utils/MTP/MTP_DLL/stdafx.h +++ b/utils/MTP/MTP_DLL/stdafx.h | |||
@@ -1,32 +1,22 @@ | |||
1 | // stdafx.h : include file for standard system include files, | 1 | #pragma once |
2 | // or project specific include files that are used frequently, but | 2 | |
3 | // are changed infrequently | 3 | /* Modify the following defines if you have to target a platform prior to the ones specified below. |
4 | // | 4 | Refer to MSDN for the latest info on corresponding values for different platforms. */ |
5 | 5 | #ifndef WINVER /* Allow use of features specific to Windows XP or later. */ | |
6 | #pragma once | 6 | #define WINVER 0x0501 /* Change this to the appropriate value to target other versions of Windows. */ |
7 | 7 | #endif | |
8 | // Modify the following defines if you have to target a platform prior to the ones specified below. | 8 | |
9 | // Refer to MSDN for the latest info on corresponding values for different platforms. | 9 | #ifndef _WIN32_WINNT /* Allow use of features specific to Windows XP or later. */ |
10 | #ifndef WINVER // Allow use of features specific to Windows XP or later. | 10 | #define _WIN32_WINNT 0x0501 /* Change this to the appropriate value to target other versions of Windows. */ |
11 | #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. | 11 | #endif |
12 | #endif | 12 | |
13 | 13 | #ifndef _WIN32_WINDOWS /* Allow use of features specific to Windows 98 or later. */ | |
14 | #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. | 14 | #define _WIN32_WINDOWS 0x0410 /* Change this to the appropriate value to target Windows Me or later. */ |
15 | #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. | 15 | #endif |
16 | #endif | 16 | |
17 | 17 | #ifndef _WIN32_IE /* Allow use of features specific to IE 6.0 or later. */ | |
18 | #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. | 18 | #define _WIN32_IE 0x0600 /* Change this to the appropriate value to target other versions of IE. */ |
19 | #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. | 19 | #endif |
20 | #endif | 20 | |
21 | 21 | #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ | |
22 | #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. | 22 | #include <windows.h> |
23 | #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. | ||
24 | #endif | ||
25 | |||
26 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers | ||
27 | // Windows Header Files: | ||
28 | #include <windows.h> | ||
29 | |||
30 | |||
31 | |||
32 | // TODO: reference additional headers your program requires here | ||