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