Initial community commit

This commit is contained in:
Jef 2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit fc06254474
16440 changed files with 4239995 additions and 2 deletions

View file

@ -0,0 +1,798 @@
#include "ASDevice.h"
#include <vector>
static void removebadchars(wchar_t *s) {
while (s && *s)
{
if (*s == L'?' || *s == L'/' || *s == L'\\' || *s == L':' || *s == L'*' || *s == L'\"' || *s == L'<' || *s == L'>' || *s == L'|')
*s = L'_';
s = CharNextW(s);
}
}
Playlist::Playlist(const wchar_t * path, LPCE_FIND_DATA f) {
_snwprintf(fn,MAX_PATH,L"%s\\%s",path,f->cFileName);
wchar_t * ext = wcsrchr(f->cFileName,L'.');
if(ext) *ext=0;
lstrcpyn(name,f->cFileName,fieldlen);
}
Playlist::Playlist(const wchar_t * name0) {
lstrcpyn(name,name0,fieldlen);
fn[0]=0;
}
#define ASSIGNLARGE(r,h,l) {ULARGE_INTEGER li; li.HighPart = h; li.LowPart = l; r=li.QuadPart;}
Song::Song(const wchar_t * path0, LPCE_FIND_DATA f, bool video) : track(-1), video(video) {
artist[0]=album[0]=title[0]=fn[0]=0;
ASSIGNLARGE(size,f->nFileSizeHigh,f->nFileSizeLow);
// first, fill in artist and album
wchar_t *path = _wcsdup(path0);
wchar_t *a = wcsrchr(path,L'\\');
if(a && a-1 != path) {
lstrcpyn(album,a+1,fieldlen);
*a=0;
a = wcsrchr(path,L'\\');
if(a && a-1 != path) lstrcpyn(artist,a+1,fieldlen);
}
// now parse out the title
_snwprintf(fn,MAX_PATH,L"%s\\%s",path0,f->cFileName);
wchar_t * ext = wcsrchr(f->cFileName,L'.');
if(ext) *ext=0;
wchar_t * p = f->cFileName;
if(memcmp(artist,p,wcslen(artist)*sizeof(wchar_t))==0) p+=wcslen(artist);
while(p && *p && (*p==L'.' || *p==L'_' || *p==L'-' || *p==L' ')) p++;
track = wcstoul(p,&p,10);
while(p && *p && (*p==L'.' || *p==L'_' || *p==L'-' || *p==L' ')) p++;
lstrcpyn(title,p,fieldlen);
if(title[0]==0) lstrcpyn(title,f->cFileName,fieldlen);
free(path);
}
Song::Song() : video(false) {}
void ASDevice::Find(const wchar_t * path) {
wchar_t fpath[MAX_PATH] = {0};
wsprintf(fpath,L"%s\\*",path);
CE_FIND_DATA f = {0};
HANDLE h = pISession->CeFindFirstFile(fpath,&f);
if(h == INVALID_HANDLE_VALUE) return;
do {
if(f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
wchar_t path2[MAX_PATH] = {0};
wsprintf(path2,L"%s\\%s",path,f.cFileName);
Find(path2);
}
else FoundFile(path,&f);
} while(pISession->CeFindNextFile(h,&f));
pISession->CeFindClose(h);
}
void ASDevice::FoundFile(const wchar_t * path, LPCE_FIND_DATA f) {
wchar_t * ext = wcsrchr(f->cFileName,L'.');
if(!_wcsicmp(ext,L".mp3") || !_wcsicmp(ext,L".wma"))
playlists[0]->songs.push_back(new Song(path,f,false));
if(!_wcsicmp(ext,L".avi") || !_wcsicmp(ext,L".wmv") || !_wcsicmp(ext,L".asf") || !_wcsicmp(ext,L".mpg") || !_wcsicmp(ext,L".mpeg"))
playlists[0]->songs.push_back(new Song(path,f,true));
else if(!_wcsicmp(ext,L".asx"))
playlists.push_back(new Playlist(path,f));
}
void fixTagsForXML(wchar_t* dest, const wchar_t *cstr, const int len)
{
int tindex = 0;
wchar_t *temp = (wchar_t*)calloc(len, sizeof(wchar_t));
for(int i=0;i<len && tindex<len;i++)
{
switch(cstr[i])
{
case(L'&'):
if(tindex < len-5)
{
temp[tindex++] = '&';
temp[tindex++] = 'a';
temp[tindex++] = 'm';
temp[tindex++] = 'p';
temp[tindex] = ';';
}
else temp[tindex] = ' '; //no room
break;
case(L'<'):
{
if(tindex < len-4)
{
temp[tindex++] = '&';
temp[tindex++] = 'l';
temp[tindex++] = 't';
temp[tindex] = ';';
}
else temp[tindex] = ' '; //no room
break;
}
case(L'>'):
{
if(tindex < len-4)
{
temp[tindex++] = '&';
temp[tindex++] = 'g';
temp[tindex++] = 't';
temp[tindex] = ';';
}
else temp[tindex] = ' '; //no room
break;
}
case(L'\"'):
{
if(tindex < len-4)
{
temp[tindex++] = '&';
temp[tindex++] = 'q';
temp[tindex++] = 'u';
temp[tindex++] = 'o';
temp[tindex++] = 't';
temp[tindex] = ';';
}
else temp[tindex] = ' '; //no room
break;
}
case(L'\''):
{
if(tindex < len-4)
{
temp[tindex++] = '&';
temp[tindex++] = 'a';
temp[tindex++] = 'p';
temp[tindex++] = 'o';
temp[tindex++] = 's';
temp[tindex] = ';';
}
else temp[tindex] = ' '; //no room
break;
}
default:
{
temp[tindex] = cstr[i];
break;
}
}
if(cstr[i] == 0) break;
tindex++;
}
wcsncpy(dest, temp, len);
free(temp);
}
void ASDevice::WritePlaylist(Playlist * pl) {
#define CePutws(x,h) pISession->CeWriteFile(h,x,(DWORD)wcslen(x)*sizeof(wchar_t),&w,NULL)
#define CePuts(x,h) pISession->CeWriteFile(h,x,(DWORD)strlen(x)*sizeof(char),&w,NULL)
HANDLE h = pISession->CeCreateFile(pl->fn,GENERIC_WRITE,FILE_SHARE_WRITE,NULL,TRUNCATE_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
if(h == INVALID_HANDLE_VALUE) return;
std::vector<Song*> *songs = &pl->songs;
int l=(int)songs->size();
DWORD w;
CePuts("<asx version=\"3.0\">\r\n",h);
for(int j=0; j<l; j++) {
CePuts("<entry><ref href=\"",h);
wchar_t safe[fieldlen*2] = {0};
fixTagsForXML(safe,songs->at(j)->fn,sizeof(safe)/sizeof(wchar_t));
AutoChar fn(safe);
CePuts(fn,h);
CePuts("\"/></entry>\r\n",h);
}
CePuts("</asx>",h);
pISession->CeCloseHandle(h);
#undef CePutws
#undef CePuts
}
struct mplSearch { bool operator()(Song*& a,Song*& b) { return _wcsicmp(a->fn,b->fn)<0; } };
struct mplSearch2 { bool operator()(Song*& a,Song* b) { return _wcsicmp(a->fn,b->fn)<0; } };
waServiceFactory *parserFactory;
class plread : public ifc_xmlreadercallback {
public:
Playlist * pl;
Playlist * mpl;
plread(Playlist * pl,Playlist * mpl) : pl(pl),mpl(mpl) {}
void StartTag(const wchar_t *xmlpath, const wchar_t *xmltag, ifc_xmlreaderparams *params) {
if(!wcscmp(xmlpath,L"ASX\fENTRY\fREF")) {
const wchar_t* path = params->getItemValue(L"HREF");
int l= (int)mpl->songs.size();
Song s;
lstrcpyn(s.fn,path,MAX_PATH);
std::vector<Song*>::iterator p = std::lower_bound(mpl->songs.begin(),mpl->songs.end(),&s,mplSearch2());
int f = (int)(p - mpl->songs.begin());
if(f >= 0 && f < (int)mpl->songs.size()) {
Song * found = mpl->songs[f];
if(!_wcsicmp(found->fn,s.fn)) pl->songs.push_back(found);
}
}
}
RECVS_DISPATCH;
};
#define CBCLASS plread
START_DISPATCH;
VCB(ONSTARTELEMENT, StartTag)
END_DISPATCH;
#undef CBCLASS
void ASDevice::ReadPlaylist(Playlist * pl) {
if(!parserFactory) return;
obj_xml * parser = (obj_xml *)parserFactory->getInterface();
if(!parser) return;
HANDLE h = pISession->CeCreateFile(pl->fn,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
if(h == INVALID_HANDLE_VALUE) { parserFactory->releaseInterface(parser); return; }
plread cb(pl,playlists[0]);
parser->xmlreader_open();
parser->xmlreader_registerCallback(L"ASX\fENTRY\f*",&cb);
for(;;) {
char buf[32768] = {0};
DWORD read = 0;
pISession->CeReadFile(h,buf,sizeof(buf),&read,NULL);
if(read == 0) break;
parser->xmlreader_feed(buf,read);
}
parserFactory->releaseInterface(parser);
pISession->CeCloseHandle(h);
}
static void findStorageCard(IRAPISession *pISession,wchar_t *storageCard) {
ULARGE_INTEGER fa={0},rootTotal={0},ft={0};
pISession->CeGetDiskFreeSpaceEx(L"\\",&fa,&rootTotal,&ft);
wchar_t *fpath = L"\\*";
CE_FIND_DATA f;
HANDLE h = pISession->CeFindFirstFile(fpath,&f);
if(h == INVALID_HANDLE_VALUE) return;
do {
if(f.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY/* && wcscmp(f.cFileName,L"Storage Card")*/) {
ULARGE_INTEGER folderTotal={0};
wchar_t path[MAX_PATH] = L"\\";
wcscat(path,f.cFileName);
pISession->CeGetDiskFreeSpaceEx(path,&fa,&folderTotal,&ft);
if(folderTotal.QuadPart > rootTotal.QuadPart) {
rootTotal = folderTotal;
wcsncpy(storageCard,path,MAX_PATH);
}
}
} while(pISession->CeFindNextFile(h,&f));
pISession->CeFindClose(h);
}
ASDevice::ASDevice(IRAPIDevice *pIDevice,IRAPISession *pISession) : pIDevice(pIDevice), pISession(pISession), transferQueueSize(0) {
pIDevice->AddRef();
pIDevice->GetDeviceInfo(&devInfo);
pmpDeviceLoading load={this,0};
SendMessage(plugin.hwndPortablesParent,WM_PMP_IPC,(intptr_t)&load,PMP_IPC_DEVICELOADING);
if(load.UpdateCaption) {
wchar_t buf[200]=L"";
wsprintf(buf,WASABI_API_LNGSTRINGW(IDS_LOADING),devInfo.bstrName);
load.UpdateCaption(buf,load.context);
}
//find where playlists and music are stored...
wchar_t storageCard[MAX_PATH]=L"";
findStorageCard(pISession,storageCard);
wsprintf(musicFolder,L"%s\\Music",storageCard);
wsprintf(videoFolder,L"%s\\My Documents\\My Videos",storageCard);
wsprintf(playlistFolder,L"%s\\Playlists",storageCard);
wcsncpy(playlistFormat,L".asx",16);
// default values found. Fill in real values
{
wchar_t inifile[MAX_PATH] = {0};
const char * iniDirectory = (const char*)SendMessage(plugin.hwndWinampParent, WM_WA_IPC, 0, IPC_GETINIDIRECTORY);
wchar_t name[256] = {0};
lstrcpyn(name,devInfo.bstrName,256);
removebadchars(name);
wsprintf(inifile,L"%s\\Plugins\\ml\\ml_pmp_device_%s.ini",(wchar_t*)AutoWide(iniDirectory),name);
wchar_t * def = _wcsdup(musicFolder);
GetPrivateProfileString(L"pmp_activesync",L"musicfolder",def,musicFolder,MAX_PATH,inifile);
free(def); def = _wcsdup(videoFolder);
GetPrivateProfileString(L"pmp_activesync",L"videofolder",def,videoFolder,MAX_PATH,inifile);
free(def); def = _wcsdup(playlistFolder);
GetPrivateProfileString(L"pmp_activesync",L"playlistfolder",def,playlistFolder,MAX_PATH,inifile);
free(def);
}
playlists.push_back(new Playlist(devInfo.bstrName));
Find(musicFolder);
Find(videoFolder);
Find(playlistFolder);
std::sort(playlists[0]->songs.begin(),playlists[0]->songs.end(),mplSearch());
parserFactory = plugin.service->service_getServiceByGuid(obj_xmlGUID);
for(unsigned int i=1; i<playlists.size(); i++)
ReadPlaylist(playlists[i]);
SendMessage(plugin.hwndPortablesParent,WM_PMP_IPC,(intptr_t)this,PMP_IPC_DEVICECONNECTED);
transcoder = (Transcoder*)SendMessage(plugin.hwndPortablesParent,WM_PMP_IPC,(intptr_t)this,PMP_IPC_GET_TRANSCODER);
transcoder->AddAcceptableFormat(L"mp3");
transcoder->AddAcceptableFormat(L"wma");
transcoder->AddAcceptableFormat(L"wmv");
transcoder->AddAcceptableFormat(L"avi");
transcoder->AddAcceptableFormat(L"asf");
transcoder->AddAcceptableFormat(L"mpeg");
transcoder->AddAcceptableFormat(L"mpg");
}
ASDevice::~ASDevice()
{
Playlist *mpl = playlists[ 0 ];
unsigned int l = (unsigned int)mpl->songs.size();
for ( unsigned int i = 0; i < l; i++ )
{
delete mpl->songs[ i ];
}
for ( unsigned int j = 0; j < playlists.size(); j++ )
{
delete playlists[ j ];
}
for ( int k = 0; k < devices.size(); k++ )
{
if ( devices[ k ] == this )
{
devices.erase( devices.begin() + k );
k--;
}
}
pIDevice->Release();
pISession->Release();
SysFreeString( devInfo.bstrName );
SysFreeString( devInfo.bstrPlatform );
SendMessage( plugin.hwndPortablesParent, WM_PMP_IPC, (WPARAM)transcoder, PMP_IPC_RELEASE_TRANSCODER );
}
__int64 ASDevice::getDeviceCapacityAvailable() {
if(devInfo.dwOsVersionMajor >= 5) {
ULARGE_INTEGER fa={0},t={0},ft={0};
pISession->CeGetDiskFreeSpaceEx(musicFolder,&fa,&t,&ft);
return fa.QuadPart;
} else {
STORE_INFORMATION s;
pISession->CeGetStoreInformation(&s);
return s.dwFreeSize;
}
}
__int64 ASDevice::getDeviceCapacityTotal() {
if(devInfo.dwOsVersionMajor >= 5) {
ULARGE_INTEGER fa={0},t={0},ft={0};
pISession->CeGetDiskFreeSpaceEx(musicFolder,&fa,&t,&ft);
return t.QuadPart;
} else {
STORE_INFORMATION s;
pISession->CeGetStoreInformation(&s);
return s.dwStoreSize;
}
}
void ASDevice::Eject() {
ejectedDevice *e = (ejectedDevice *)calloc(1, sizeof(ejectedDevice));
e->id = devInfo.DeviceId;
e->marked = true;
ejected.push_back(e);
Close();
}
void ASDevice::Close() {
SendMessage(plugin.hwndPortablesParent,WM_PMP_IPC,(intptr_t)this,PMP_IPC_DEVICEDISCONNECTED);
delete this;
}
int ASDevice::transferTrackToDevice(const itemRecordW * track,void * callbackContext,void (*callback)(void * callbackContext, wchar_t * status),songid_t * songid,int * killswitch) {
wchar_t ext[10]={0};
wchar_t file[2048]={0};
wcsncpy(file,track->filename,2048);
{wchar_t * e = wcsrchr(file,L'.'); if(e) wcsncpy(ext,e+1,10);}
bool deletefile = false;
if(transcoder->ShouldTranscode(file)) {
wchar_t newfile[MAX_PATH] = {0};
transcoder->CanTranscode(file,ext);
transcoder->GetTempFilePath(ext,newfile);
if(transcoder->TranscodeFile(file,newfile,killswitch,callback,callbackContext)) return -1;
wcsncpy(file,newfile,2048);
deletefile=true;
}
callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_TRANSFERRING));
bool video = !_wcsicmp(ext,L"wmv") || !_wcsicmp(ext,L"avi");
int len = (int)(wcslen(musicFolder)+wcslen(track->artist)+wcslen(track->album)+wcslen(track->title)+100);
wchar_t *path = (wchar_t*)calloc(len, sizeof(wchar_t));
wchar_t *artist = _wcsdup(track->artist);
wchar_t *album = _wcsdup(track->album);
wchar_t *title = _wcsdup(track->title);
removebadchars(artist);
removebadchars(album);
removebadchars(title);
if(video) {
wcsncpy(path,videoFolder,len);
pISession->CeCreateDirectory(path,NULL);
wsprintf(path+wcslen(path),L"\\%s - %s.%s",artist,title,ext);
} else {
wcsncpy(path,musicFolder,len);
pISession->CeCreateDirectory(path,NULL);
wcscat(path,L"\\");
wcscat(path,artist);
pISession->CeCreateDirectory(path,NULL);
wcscat(path,L"\\");
wcscat(path,album);
pISession->CeCreateDirectory(path,NULL);
wsprintf(path+wcslen(path),L"\\%02d - %s.%s",track->track,title,ext);
}
free(artist); free(album); free(title);
FILE *f = _wfopen(file,L"rb");
if(!f) { callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_CANNOT_OPEN_LOCAL_FILE)); return -1; }
HANDLE h = pISession->CeCreateFile(path,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
if(h == INVALID_HANDLE_VALUE) {
callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_CANNOT_OPEN_FILE_ON_DEVICE));
fclose(f);
return -1;
}
fseek(f,0,2);
int error=0;
int size = ftell(f);
int pc = size/100;
fseek(f,0,0);
int written=0,lastupdate=0;
for(;;) {
char buf[32768] = {0};
int l = (int)fread(buf,1,sizeof(buf),f);
if(!l) break;
DWORD wl=0;
pISession->CeWriteFile(h,buf,l,&wl,NULL);
if(wl != l) {
callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_ERROR_WRITING_FILE));
error=1;
break;
}
written += l;
if(written - lastupdate > pc) {
lastupdate = written;
wchar_t buf[100] = {0};
wsprintf(buf,WASABI_API_LNGSTRINGW(IDS_TRANSFERRING_PERCENT),written/(size/100));
callback(callbackContext,buf);
}
}
fclose(f);
pISession->CeCloseHandle(h);
if(deletefile) _wunlink(file);
if(!error) {
callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_DONE));
Song * s = new Song;
lstrcpyn(s->fn,path,MAX_PATH);
lstrcpyn(s->album,track->album,fieldlen);
lstrcpyn(s->artist,track->artist,fieldlen);
lstrcpyn(s->title,track->title,fieldlen);
s->track = track->track;
s->size = size;
s->video = video;
*songid = (songid_t)s;
}
free(path);
return error?-1:0;
}
static __int64 fileSize(wchar_t * filename)
{
WIN32_FIND_DATA f={0};
HANDLE h = FindFirstFileW(filename,&f);
if(h == INVALID_HANDLE_VALUE) return -1;
FindClose(h);
ULARGE_INTEGER i;
i.HighPart = f.nFileSizeHigh;
i.LowPart = f.nFileSizeLow;
return i.QuadPart;
}
static bool extentionSupported(wchar_t * ext) {
if(!ext) return false;
bool supported=false;
if(!_wcsicmp(ext,L".mp3") || !_wcsicmp(ext,L".wma")) supported=true;
if(!_wcsicmp(ext,L".avi") || !_wcsicmp(ext,L".wmv")) supported=true;
return supported;
}
int ASDevice::trackAddedToTransferQueue(const itemRecordW * track) {
__int64 s = getTrackSizeOnDevice(track);
if(!s) return -2;
__int64 avail = getDeviceCapacityAvailable();
__int64 cmp = transferQueueSize;
cmp += s;
if(cmp > avail) return -1;
else {
transferQueueSize += s;
return 0;
}
}
void ASDevice::trackRemovedFromTransferQueue(const itemRecordW * track) {
transferQueueSize -= getTrackSizeOnDevice(track);
}
__int64 ASDevice::getTrackSizeOnDevice(const itemRecordW * track) {
if(transcoder->ShouldTranscode(track->filename)) {
int k = transcoder->CanTranscode(track->filename);
if(k != -1 && k != 0) return k;
}
wchar_t * ext = wcsrchr(track->filename,L'.');
if(!extentionSupported(ext)) return 0;
return fileSize(track->filename);
}
void ASDevice::deleteTrack(songid_t songid) {
Song * song = (Song*)songid;
if(!pISession->CeDeleteFile(song->fn)) return;
for(unsigned int i=0; i<playlists.size(); i++)
{
unsigned int l = (unsigned int)playlists[i]->songs.size();
for(int j=0; j<l; j++)
{
if(playlists[i]->songs[j] == song)
{
playlists[i]->songs.erase(playlists[i]->songs.begin() + j);
j--;
l--;
playlists[i]->dirty=true;
}
}
}
delete song;
}
void ASDevice::commitChanges() {
for(unsigned int i=1; i<playlists.size(); i++) if(playlists[i]->dirty) { WritePlaylist(playlists[i]); playlists[i]->dirty=false; }
}
int ASDevice::getPlaylistCount() { return (int)playlists.size(); }
void ASDevice::getPlaylistName(int playlistnumber, wchar_t * buf, int len) { lstrcpyn(buf,playlists[playlistnumber]->name,len); }
int ASDevice::getPlaylistLength(int playlistnumber) { return (int)playlists[playlistnumber]->songs.size(); }
songid_t ASDevice::getPlaylistTrack(int playlistnumber,int songnum) { return (songid_t)playlists[playlistnumber]->songs[songnum]; }
void ASDevice::setPlaylistName(int playlistnumber, const wchar_t * buf) {
Playlist * pl = playlists[playlistnumber];
lstrcpyn(pl->name,buf,fieldlen);
wchar_t * oldname = _wcsdup(pl->fn);
wchar_t * name = _wcsdup(buf);
removebadchars(name);
wsprintf(pl->fn,L"%s\\%s.%s",playlistFolder,name,playlistFormat);
free(name);
pISession->CeMoveFile(oldname,pl->fn);
free(oldname);
}
void ASDevice::playlistSwapItems(int playlistnumber, int posA, int posB) {
std::vector<Song*> &songs = playlists[playlistnumber]->songs;
Song * a = songs[posA];
Song * b = songs[posB];
songs[posA] = b;
songs[posB] = a;
playlists[playlistnumber]->dirty=true;
}
#define CMPFIELDS(x) { int v = lstrcmpi(a->x,b->x); if(v) return v<0; }
#define CMPINTFIELDS(x) { int v = a->x-b->x; if(v) return v<0; }
typedef struct PlaylistItemSort {
int use_by;
bool operator()(Song*& a,Song*& b) {
int x;
for (x = 0; x < 4; x ++)
{
if (use_by == SORTBY_TITLE) // title -> artist -> album -> disc -> track
{
CMPFIELDS(title);
use_by=SORTBY_ARTIST;
}
else if (use_by == SORTBY_ARTIST) // artist -> album -> disc -> track -> title
{
CMPFIELDS(artist);
use_by=SORTBY_ALBUM;
}
else if (use_by == SORTBY_ALBUM) // album -> disc -> track -> title -> artist
{
CMPFIELDS(album);
use_by=SORTBY_TRACKNUM;
}
else if (use_by == SORTBY_TRACKNUM) // track -> title -> artist -> album -> disc
{
CMPINTFIELDS(track);
use_by=SORTBY_TITLE;
}
else break; // no sort order?
}
return false;
}
} PlaylistItemSort;
#undef CMPFIELDS
#undef CMPINTFIELDS
void ASDevice::sortPlaylist(int playlistnumber, int sortBy) {
PlaylistItemSort sort;
sort.use_by = sortBy;
std::sort(playlists[playlistnumber]->songs.begin(),playlists[playlistnumber]->songs.end(),sort);
playlists[playlistnumber]->dirty=true;
}
void ASDevice::addTrackToPlaylist(int playlistnumber, songid_t songid){
playlists[playlistnumber]->songs.push_back((Song*)songid);
playlists[playlistnumber]->dirty=true;
}
void ASDevice::removeTrackFromPlaylist(int playlistnumber, int songnum) {
playlists[playlistnumber]->songs.erase(playlists[playlistnumber]->songs.begin() + songnum);
playlists[playlistnumber]->dirty=true;
}
void ASDevice::deletePlaylist(int playlistnumber) {
pISession->CeDeleteFile(playlists[playlistnumber]->fn);
delete playlists[playlistnumber];
playlists.erase(playlists.begin() + playlistnumber);
}
int ASDevice::newPlaylist(const wchar_t * name0) {
pISession->CeCreateDirectory(playlistFolder,NULL);
Playlist* pl = new Playlist(name0);
wchar_t * name = _wcsdup(name0);
removebadchars(name);
wsprintf(pl->fn,L"%s\\%s.%s",playlistFolder,name,playlistFormat);
free(name);
pl->dirty=true;
playlists.push_back(pl);
return (int)playlists.size()-1;
}
void ASDevice::getTrackArtist(songid_t songid, wchar_t * buf, int len) { lstrcpyn(buf,((Song*)songid)->artist,len); }
void ASDevice::getTrackAlbum(songid_t songid, wchar_t * buf, int len) { lstrcpyn(buf,((Song*)songid)->album,len); }
void ASDevice::getTrackTitle(songid_t songid, wchar_t * buf, int len) { lstrcpyn(buf,((Song*)songid)->title,len); }
int ASDevice::getTrackTrackNum(songid_t songid) { return ((Song*)songid)->track; }
__int64 ASDevice::getTrackSize(songid_t songid) { return ((Song*)songid)->size; }
void ASDevice::getTrackExtraInfo(songid_t songid, const wchar_t * field, wchar_t * buf, int len) {
if(!wcscmp(field,FIELD_EXTENSION)) {
Song * s = (Song *)songid;
wchar_t * ext = wcsrchr(s->fn,L'.');
if(ext) { ext++; lstrcpyn(buf,ext,len); }
}
}
int ASDevice::copyToHardDrive(songid_t song,wchar_t * path,void * callbackContext,void (*callback)(void * callbackContext, wchar_t * status),int * killswitch) {
Song * s = (Song*)song;
wchar_t * ext = wcsrchr(s->fn,L'.');
if(ext && wcslen(ext)<10) wcscat(path,ext);
callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_TRANSFERRING));
FILE * f = _wfopen(path,L"wb");
if(!f) {
callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_CANNOT_OPEN_DESTINATION));
return -1;
}
HANDLE h = pISession->CeCreateFile(s->fn,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_FLAG_SEQUENTIAL_SCAN,NULL);
if(h == INVALID_HANDLE_VALUE) {
callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_CANNOT_OPEN_FILE_ON_DEVICE));
fclose(f);
return -1;
}
int error=0;
int pc = (int)(s->size/100);
int written=0,lastupdate=0;
for(;;) {
char buf[32768] = {0};
DWORD read=0;
pISession->CeReadFile(h,buf,sizeof(buf),&read,NULL);
if(!read) break;
int wr = (int)fwrite(buf,1,read,f);
if(wr != read) {
callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_ERROR_WRITING_FILE));
error=1;
break;
}
written += read;
if(written - lastupdate > pc) {
lastupdate = written;
wchar_t buf[100] = {0};
wsprintf(buf,WASABI_API_LNGSTRINGW(IDS_TRANSFERRING),written/(s->size/100));
callback(callbackContext,buf);
}
}
pISession->CeCloseHandle(h);
fclose(f);
if(!error) {
callback(callbackContext,WASABI_API_LNGSTRINGW(IDS_DONE));
return 0;
} else return -1;
}
static BOOL CALLBACK config_dialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
intptr_t ASDevice::extraActions(intptr_t param1, intptr_t param2, intptr_t param3,intptr_t param4) {
switch(param1) {
case DEVICE_SET_ICON:
{
MLTREEIMAGE * i = (MLTREEIMAGE*)param2;
i->hinst = plugin.hDllInstance;
i->resourceId = IDR_ACTIVESYNC_ICON;
}
break;
case DEVICE_SUPPORTED_METADATA: return 0x8f;
case DEVICE_DOES_NOT_SUPPORT_EDITING_METADATA: return 1;
case DEVICE_GET_PREFS_DIALOG:
if(param3 == 0) {
pref_tab * p = (pref_tab *)param2;
p->hinst = WASABI_API_LNG_HINST;
p->dlg_proc = (DLGPROC)config_dialogProc;
p->res_id = IDD_CONFIG;
lstrcpyn(p->title,WASABI_API_LNGSTRINGW(IDS_ADVANCED),100);
}
break;
case DEVICE_SUPPORTS_VIDEO:
return 1;
}
return 0;
}
static BOOL CALLBACK config_dialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam) {
static ASDevice * dev;
switch(uMsg) {
case WM_INITDIALOG:
{
prefsParam* p = (prefsParam*)lParam;
dev = (ASDevice*)p->dev;
p->config_tab_init(hwndDlg,p->parent);
SetDlgItemText(hwndDlg,IDC_FOLDER_MUSIC,dev->musicFolder);
SetDlgItemText(hwndDlg,IDC_FOLDER_VIDEO,dev->videoFolder);
SetDlgItemText(hwndDlg,IDC_FOLDER_PLAYLIST,dev->playlistFolder);
}
break;
case WM_DESTROY:
{
GetDlgItemText(hwndDlg,IDC_FOLDER_MUSIC,dev->musicFolder,MAX_PATH);
GetDlgItemText(hwndDlg,IDC_FOLDER_VIDEO,dev->videoFolder,MAX_PATH);
GetDlgItemText(hwndDlg,IDC_FOLDER_PLAYLIST,dev->playlistFolder,MAX_PATH);
wchar_t *inifile = (wchar_t*)SendMessage(plugin.hwndPortablesParent,WM_PMP_IPC,(intptr_t)dev,PMP_IPC_GET_INI_FILE);
#if 1
wchar_t inifil[MAX_PATH] = {0};
if(!inifile) {
inifile=inifil;
const char * iniDirectory = (const char*)SendMessage(plugin.hwndWinampParent, WM_WA_IPC, 0, IPC_GETINIDIRECTORY);
wchar_t name[256] = {0};
lstrcpyn(name,dev->devInfo.bstrName,256);
removebadchars(name);
wsprintf(inifile,L"%s\\Plugins\\ml\\ml_pmp_device_%s.ini",(wchar_t*)AutoWide(iniDirectory),name);
}
#endif
if(inifile) {
WritePrivateProfileString(L"pmp_activesync",L"musicfolder",dev->musicFolder,inifile);
WritePrivateProfileString(L"pmp_activesync",L"videofolder",dev->videoFolder,inifile);
WritePrivateProfileString(L"pmp_activesync",L"playlistfolder",dev->playlistFolder,inifile);
}
}
break;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDC_RESCAN:
config_dialogProc(hwndDlg,WM_DESTROY,0,0);
dev->Close();
break;
}
break;
}
return 0;
}

View file

@ -0,0 +1,172 @@
#define _WIN32_DCOM
#include <winsock2.h>
#include <windows.h>
#include <windowsx.h>
#include <rapi2.h>
#include <shlobj.h>
//#include <vector>
#include <algorithm>
#include <vector>
#include "../Winamp/wa_ipc.h"
#include "../Plugins/General/gen_ml/ml.h"
#include "../Plugins/Library/ml_pmp/pmp.h"
#include "../Plugins/Library/ml_pmp/transcoder.h"
#include "../nu/AutoWide.h"
#include "../nu/AutoChar.h"
#include <api/service/waservicefactory.h>
#include "../playlist/ifc_playlistloader.h"
#include "../xml/ifc_xmlreadercallback.h"
#include "../xml/obj_xml.h"
#include "../xml/api__xml.h"
#include "../Agave/Language/api_language.h"
#include "resource.h"
typedef struct {
RAPIDEVICEID id;
bool marked;
} ejectedDevice;
extern PMPDevicePlugin plugin;
extern std::vector<ejectedDevice*> ejected;
#define fieldlen 128
class Song {
public:
wchar_t artist[fieldlen],album[fieldlen],title[fieldlen];
wchar_t fn[MAX_PATH];
int track;
__int64 size;
bool video;
Song(const wchar_t * path, LPCE_FIND_DATA f, bool video);
Song();
};
class Playlist {
public:
std::vector<Song*> songs;
wchar_t name[fieldlen];
wchar_t fn[MAX_PATH];
bool dirty;
Playlist(const wchar_t * path, LPCE_FIND_DATA f);
Playlist(const wchar_t * name);
};
class ASDevice : public Device {
public:
wchar_t musicFolder[MAX_PATH];
wchar_t videoFolder[MAX_PATH];
wchar_t playlistFolder[MAX_PATH];
wchar_t playlistFormat[16];
IRAPIDevice *pIDevice;
IRAPISession *pISession;
Transcoder * transcoder;
RAPI_DEVICEINFO devInfo;
__int64 transferQueueSize;
std::vector<Playlist*> playlists;
void Find(const wchar_t * dir);
void FoundFile(const wchar_t * path, LPCE_FIND_DATA f);
void WritePlaylist(Playlist * pl);
void ReadPlaylist(Playlist * pl);
ASDevice(IRAPIDevice *pIDevice,IRAPISession *pISession);
~ASDevice();
virtual __int64 getDeviceCapacityAvailable(); // in bytes
virtual __int64 getDeviceCapacityTotal(); // in bytes
virtual void Eject();
virtual void Close(); // save any changes, and call PMP_IPC_DEVICEDISCONNECTED AND delete this;
// return 0 for success, -1 for failed or cancelled
virtual int transferTrackToDevice(const itemRecordW * track, // the track to transfer
void * callbackContext, //pass this to the callback
void (*callback)(void * callbackContext, wchar_t * status), // call this every so often so the GUI can be updated. Including when finished!
songid_t * songid, // fill in the songid when you are finished
int * killswitch // if this gets set to anything other than zero, the transfer has been cancelled by the user
);
virtual int trackAddedToTransferQueue(const itemRecordW * track); // return 0 to accept, -1 for "not enough space", -2 for "incorrect format"
virtual void trackRemovedFromTransferQueue(const itemRecordW * track);
// return the amount of space that will be taken up on the device by the track (once it has been tranferred)
// or 0 for incompatable. This is usually the filesize, unless you are transcoding. An estimate is acceptable.
virtual __int64 getTrackSizeOnDevice(const itemRecordW * track);
virtual void deleteTrack(songid_t songid); // physically remove from device. Be sure to remove it from all the playlists!
virtual void commitChanges(); // optional. Will be called at a good time to save changes
virtual int getPlaylistCount(); // always at least 1. playlistnumber 0 is the Master Playlist containing all tracks.
// PlaylistName(0) should return the name of the device.
virtual void getPlaylistName(int playlistnumber, wchar_t * buf, int len);
virtual int getPlaylistLength(int playlistnumber);
virtual songid_t getPlaylistTrack(int playlistnumber,int songnum); // returns a songid
virtual void setPlaylistName(int playlistnumber, const wchar_t * buf); // with playlistnumber==0, set the name of the device.
virtual void playlistSwapItems(int playlistnumber, int posA, int posB); // swap the songs at position posA and posB
virtual void sortPlaylist(int playlistnumber, int sortBy);
virtual void addTrackToPlaylist(int playlistnumber, songid_t songid); // adds songid to the end of the playlist
virtual void removeTrackFromPlaylist(int playlistnumber, int songnum); //where songnum is the position of the track in the playlist
virtual void deletePlaylist(int playlistnumber);
virtual int newPlaylist(const wchar_t * name); // create empty playlist, returns playlistnumber. -1 for failed.
virtual void getTrackArtist(songid_t songid, wchar_t * buf, int len);
virtual void getTrackAlbum(songid_t songid, wchar_t * buf, int len);
virtual void getTrackTitle(songid_t songid, wchar_t * buf, int len);
virtual int getTrackTrackNum(songid_t songid);
virtual int getTrackDiscNum(songid_t songid){return -1;}
virtual void getTrackGenre(songid_t songid, wchar_t * buf, int len){buf[0]=0;}
virtual int getTrackYear(songid_t songid){return -1;}
virtual __int64 getTrackSize(songid_t songid); // in bytes
virtual int getTrackLength(songid_t songid){return -1;} // in millisecs
virtual int getTrackBitrate(songid_t songid){return -1;} // in kbps
virtual int getTrackPlayCount(songid_t songid){return 0;}
virtual int getTrackRating(songid_t songid){return 0;} //0-5
virtual __time64_t getTrackLastPlayed(songid_t songid){return 0;} // in unix time format
virtual __time64_t getTrackLastUpdated(songid_t songid){return 0;} // in unix time format
virtual int getTrackType(songid_t songid) { return ((Song *)songid)->video?1:0; }
virtual void getTrackExtraInfo(songid_t songid, const wchar_t * field, wchar_t * buf, int len); //optional
// feel free to ignore any you don't support
virtual void setTrackArtist(songid_t songid, const wchar_t * value){}
virtual void setTrackAlbum(songid_t songid, const wchar_t * value){}
virtual void setTrackTitle(songid_t songid, const wchar_t * value){}
virtual void setTrackTrackNum(songid_t songid, int value){}
virtual void setTrackDiscNum(songid_t songid, int value){}
virtual void setTrackGenre(songid_t songid, const wchar_t * value){}
virtual void setTrackYear(songid_t songid, int year){}
virtual void setTrackPlayCount(songid_t songid, int value){}
virtual void setTrackRating(songid_t songid, int value){}
virtual void setTrackLastPlayed(songid_t songid, __time64_t value){} // in unix time format
virtual void setTrackLastUpdated(songid_t songid, __time64_t value){} // in unix time format
virtual void setTrackExtraInfo(songid_t songid, const wchar_t * field, const wchar_t * value) {}; //optional
virtual bool playTracks(songid_t * songidList, int listLength, int startPlaybackAt, bool enqueue){return false;} // return false if unsupported
virtual intptr_t extraActions(intptr_t param1, intptr_t param2, intptr_t param3,intptr_t param4);
// new methods as of PMPHDR_VER 0x002
virtual bool copyToHardDriveSupported() {return true;}
virtual __int64 songSizeOnHardDrive(songid_t song) {return getTrackSize(song);} // how big a song will be when copied back. Return -1 for not supported.
virtual int copyToHardDrive(songid_t song, // the song to copy
wchar_t * path, // path to copy to, in the form "c:\directory\song". The directory will already be created, you must append ".mp3" or whatever to this string! (there is space for at least 10 new characters).
void * callbackContext, //pass this to the callback
void (*callback)(void * callbackContext, wchar_t * status), // call this every so often so the GUI can be updated. Including when finished!
int * killswitch // if this gets set to anything other than zero, the transfer has been cancelled by the user
); // -1 for failed/not supported. 0 for success.
};
extern std::vector<ASDevice*> devices;

View file

@ -0,0 +1,286 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 6.00.0361 */
/* at Fri Sep 17 22:09:50 2004
*/
/* Compiler settings for ..\IRAPIStream.idl:
Oicf, W1, Zp8, env=Win32 (32b run)
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING( )
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __IRAPIStream_h__
#define __IRAPIStream_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IRAPIStream_FWD_DEFINED__
#define __IRAPIStream_FWD_DEFINED__
typedef interface IRAPIStream IRAPIStream;
#endif /* __IRAPIStream_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#include "rapitypes.h"
#ifdef __cplusplus
extern "C"{
#endif
void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * );
#ifndef __IRAPIStream_INTERFACE_DEFINED__
#define __IRAPIStream_INTERFACE_DEFINED__
/* interface IRAPIStream */
/* [object][uuid] */
EXTERN_C const IID IID_IRAPIStream;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("449FE623-24B0-454b-A889-129BB05DDBED")
IRAPIStream : public IStream
{
public:
virtual HRESULT STDMETHODCALLTYPE SetRapiStat(
/* [in] */ RAPISTREAMFLAG Flag,
/* [in] */ DWORD dwValue) = 0;
virtual HRESULT STDMETHODCALLTYPE GetRapiStat(
/* [in] */ RAPISTREAMFLAG Flag,
/* [out] */ DWORD *pdwValue) = 0;
};
#else /* C style interface */
typedef struct IRAPIStreamVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IRAPIStream * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IRAPIStream * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IRAPIStream * This);
/* [local] */ HRESULT ( STDMETHODCALLTYPE *Read )(
IRAPIStream * This,
/* [length_is][size_is][out] */ void *pv,
/* [in] */ ULONG cb,
/* [out] */ ULONG *pcbRead);
/* [local] */ HRESULT ( STDMETHODCALLTYPE *Write )(
IRAPIStream * This,
/* [size_is][in] */ const void *pv,
/* [in] */ ULONG cb,
/* [out] */ ULONG *pcbWritten);
/* [local] */ HRESULT ( STDMETHODCALLTYPE *Seek )(
IRAPIStream * This,
/* [in] */ LARGE_INTEGER dlibMove,
/* [in] */ DWORD dwOrigin,
/* [out] */ ULARGE_INTEGER *plibNewPosition);
HRESULT ( STDMETHODCALLTYPE *SetSize )(
IRAPIStream * This,
/* [in] */ ULARGE_INTEGER libNewSize);
/* [local] */ HRESULT ( STDMETHODCALLTYPE *CopyTo )(
IRAPIStream * This,
/* [unique][in] */ IStream *pstm,
/* [in] */ ULARGE_INTEGER cb,
/* [out] */ ULARGE_INTEGER *pcbRead,
/* [out] */ ULARGE_INTEGER *pcbWritten);
HRESULT ( STDMETHODCALLTYPE *Commit )(
IRAPIStream * This,
/* [in] */ DWORD grfCommitFlags);
HRESULT ( STDMETHODCALLTYPE *Revert )(
IRAPIStream * This);
HRESULT ( STDMETHODCALLTYPE *LockRegion )(
IRAPIStream * This,
/* [in] */ ULARGE_INTEGER libOffset,
/* [in] */ ULARGE_INTEGER cb,
/* [in] */ DWORD dwLockType);
HRESULT ( STDMETHODCALLTYPE *UnlockRegion )(
IRAPIStream * This,
/* [in] */ ULARGE_INTEGER libOffset,
/* [in] */ ULARGE_INTEGER cb,
/* [in] */ DWORD dwLockType);
HRESULT ( STDMETHODCALLTYPE *Stat )(
IRAPIStream * This,
/* [out] */ STATSTG *pstatstg,
/* [in] */ DWORD grfStatFlag);
HRESULT ( STDMETHODCALLTYPE *Clone )(
IRAPIStream * This,
/* [out] */ IStream **ppstm);
HRESULT ( STDMETHODCALLTYPE *SetRapiStat )(
IRAPIStream * This,
/* [in] */ RAPISTREAMFLAG Flag,
/* [in] */ DWORD dwValue);
HRESULT ( STDMETHODCALLTYPE *GetRapiStat )(
IRAPIStream * This,
/* [in] */ RAPISTREAMFLAG Flag,
/* [out] */ DWORD *pdwValue);
END_INTERFACE
} IRAPIStreamVtbl;
interface IRAPIStream
{
CONST_VTBL struct IRAPIStreamVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IRAPIStream_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IRAPIStream_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IRAPIStream_Release(This) \
(This)->lpVtbl -> Release(This)
#define IRAPIStream_Read(This,pv,cb,pcbRead) \
(This)->lpVtbl -> Read(This,pv,cb,pcbRead)
#define IRAPIStream_Write(This,pv,cb,pcbWritten) \
(This)->lpVtbl -> Write(This,pv,cb,pcbWritten)
#define IRAPIStream_Seek(This,dlibMove,dwOrigin,plibNewPosition) \
(This)->lpVtbl -> Seek(This,dlibMove,dwOrigin,plibNewPosition)
#define IRAPIStream_SetSize(This,libNewSize) \
(This)->lpVtbl -> SetSize(This,libNewSize)
#define IRAPIStream_CopyTo(This,pstm,cb,pcbRead,pcbWritten) \
(This)->lpVtbl -> CopyTo(This,pstm,cb,pcbRead,pcbWritten)
#define IRAPIStream_Commit(This,grfCommitFlags) \
(This)->lpVtbl -> Commit(This,grfCommitFlags)
#define IRAPIStream_Revert(This) \
(This)->lpVtbl -> Revert(This)
#define IRAPIStream_LockRegion(This,libOffset,cb,dwLockType) \
(This)->lpVtbl -> LockRegion(This,libOffset,cb,dwLockType)
#define IRAPIStream_UnlockRegion(This,libOffset,cb,dwLockType) \
(This)->lpVtbl -> UnlockRegion(This,libOffset,cb,dwLockType)
#define IRAPIStream_Stat(This,pstatstg,grfStatFlag) \
(This)->lpVtbl -> Stat(This,pstatstg,grfStatFlag)
#define IRAPIStream_Clone(This,ppstm) \
(This)->lpVtbl -> Clone(This,ppstm)
#define IRAPIStream_SetRapiStat(This,Flag,dwValue) \
(This)->lpVtbl -> SetRapiStat(This,Flag,dwValue)
#define IRAPIStream_GetRapiStat(This,Flag,pdwValue) \
(This)->lpVtbl -> GetRapiStat(This,Flag,pdwValue)
#endif /* COBJMACROS */
#endif /* C style interface */
HRESULT STDMETHODCALLTYPE IRAPIStream_SetRapiStat_Proxy(
IRAPIStream * This,
/* [in] */ RAPISTREAMFLAG Flag,
/* [in] */ DWORD dwValue);
void __RPC_STUB IRAPIStream_SetRapiStat_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
HRESULT STDMETHODCALLTYPE IRAPIStream_GetRapiStat_Proxy(
IRAPIStream * This,
/* [in] */ RAPISTREAMFLAG Flag,
/* [out] */ DWORD *pdwValue);
void __RPC_STUB IRAPIStream_GetRapiStat_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IRAPIStream_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,118 @@
// --------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Module:
//
// rapi.h
//
// Purpose:
//
// Master include file for Windows CE Remote API
//
// --------------------------------------------------------------------------
#ifndef RAPI_H
#define RAPI_H
#include <windows.h>
#include "rapitypes.h"
#include "irapistream.h"
#ifndef UNDER_CE
STDAPI CeRapiInitEx(RAPIINIT*);
STDAPI CeRapiInit();
STDAPI CeRapiUninit();
STDAPI CeRapiGetError(void);
STDAPI CeRapiFreeBuffer(LPVOID);
STDAPI_( HRESULT ) CeRapiInvoke(LPCWSTR, LPCWSTR,DWORD,BYTE *, DWORD *,BYTE **, IRAPIStream **,DWORD);
STDAPI_(CEOID) CeCreateDatabase (LPWSTR, DWORD, WORD, SORTORDERSPEC*);
STDAPI_(BOOL ) CeDeleteDatabase (CEOID);
STDAPI_(BOOL ) CeDeleteRecord (HANDLE, CEOID);
STDAPI_(HANDLE) CeFindFirstDatabase (DWORD);
STDAPI_(CEOID) CeFindNextDatabase (HANDLE);
STDAPI_(BOOL ) CeOidGetInfo (CEOID, CEOIDINFO*);
STDAPI_(HANDLE) CeOpenDatabase (PCEOID, LPWSTR, CEPROPID, DWORD, HWND);
STDAPI_(CEOID) CeReadRecordProps (HANDLE, DWORD, LPWORD, CEPROPID*, LPBYTE*, LPDWORD);
STDAPI_(CEOID) CeSeekDatabase (HANDLE, DWORD, DWORD, LPDWORD);
STDAPI_(BOOL ) CeSetDatabaseInfo (CEOID, CEDBASEINFO*);
STDAPI_(HANDLE) CeFindFirstFile (LPCWSTR, LPCE_FIND_DATA);
STDAPI_(BOOL ) CeFindNextFile (HANDLE, LPCE_FIND_DATA);
STDAPI_(BOOL ) CeFindClose (HANDLE);
STDAPI_(DWORD ) CeGetFileAttributes (LPCWSTR);
STDAPI_(BOOL ) CeSetFileAttributes (LPCWSTR, DWORD);
STDAPI_(HANDLE) CeCreateFile (LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE);
STDAPI_(BOOL ) CeReadFile (HANDLE, LPVOID, DWORD, LPDWORD, LPOVERLAPPED);
STDAPI_(BOOL ) CeWriteFile (HANDLE, LPCVOID, DWORD, LPDWORD, LPOVERLAPPED);
STDAPI_(BOOL ) CeCloseHandle (HANDLE);
STDAPI_(BOOL ) CeFindAllFiles (LPCWSTR, DWORD, LPDWORD, LPLPCE_FIND_DATA);
STDAPI_(BOOL ) CeFindAllDatabases (DWORD, WORD, LPWORD, LPLPCEDB_FIND_DATA);
STDAPI_(DWORD ) CeGetLastError (void);
STDAPI_(DWORD ) CeSetFilePointer (HANDLE, LONG, PLONG, DWORD);
STDAPI_(BOOL ) CeSetEndOfFile (HANDLE);
STDAPI_(BOOL ) CeCreateDirectory (LPCWSTR, LPSECURITY_ATTRIBUTES);
STDAPI_(BOOL ) CeRemoveDirectory (LPCWSTR);
STDAPI_(BOOL ) CeCreateProcess (LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPWSTR, LPSTARTUPINFO, LPPROCESS_INFORMATION);
STDAPI_(BOOL ) CeMoveFile (LPCWSTR, LPCWSTR);
STDAPI_(BOOL ) CeCopyFile (LPCWSTR, LPCWSTR, BOOL);
STDAPI_(BOOL ) CeDeleteFile (LPCWSTR);
STDAPI_(DWORD ) CeGetFileSize (HANDLE, LPDWORD);
STDAPI_(LONG ) CeRegOpenKeyEx (HKEY, LPCWSTR, DWORD, REGSAM, PHKEY);
STDAPI_(LONG ) CeRegEnumKeyEx (HKEY, DWORD, LPWSTR, LPDWORD, LPDWORD, LPWSTR, LPDWORD, PFILETIME);
STDAPI_(LONG ) CeRegCreateKeyEx (HKEY, LPCWSTR, DWORD, LPWSTR, DWORD, REGSAM, LPSECURITY_ATTRIBUTES, PHKEY, LPDWORD);
STDAPI_(LONG ) CeRegCloseKey (HKEY);
STDAPI_(LONG ) CeRegDeleteKey (HKEY, LPCWSTR);
STDAPI_(LONG ) CeRegEnumValue (HKEY, DWORD, LPWSTR, LPDWORD, LPDWORD, LPDWORD, LPBYTE, LPDWORD);
STDAPI_(LONG ) CeRegDeleteValue (HKEY, LPCWSTR);
STDAPI_(LONG ) CeRegQueryInfoKey (HKEY, LPWSTR, LPDWORD, LPDWORD, LPDWORD, LPDWORD, LPDWORD, LPDWORD, LPDWORD, LPDWORD, LPDWORD, PFILETIME);
STDAPI_(LONG ) CeRegQueryValueEx (HKEY, LPCWSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD);
STDAPI_(LONG ) CeRegSetValueEx (HKEY, LPCWSTR, DWORD, DWORD, LPBYTE, DWORD);
STDAPI_(BOOL ) CeGetStoreInformation(LPSTORE_INFORMATION);
STDAPI_(INT ) CeGetSystemMetrics (INT);
STDAPI_(INT ) CeGetDesktopDeviceCaps(INT);
STDAPI_(VOID ) CeGetSystemInfo (LPSYSTEM_INFO);
STDAPI_(DWORD ) CeSHCreateShortcut (LPWSTR, LPWSTR);
STDAPI_(BOOL ) CeSHGetShortcutTarget(LPWSTR, LPWSTR, INT);
STDAPI_(BOOL ) CeCheckPassword (LPWSTR);
STDAPI_(BOOL ) CeGetFileTime (HANDLE, LPFILETIME, LPFILETIME, LPFILETIME);
STDAPI_(BOOL ) CeSetFileTime (HANDLE, LPFILETIME, LPFILETIME, LPFILETIME);
STDAPI_(BOOL ) CeGetVersionEx (LPCEOSVERSIONINFO);
STDAPI_(HWND ) CeGetWindow (HWND, UINT);
STDAPI_(LONG ) CeGetWindowLong (HWND, int);
STDAPI_(int ) CeGetWindowText (HWND, LPWSTR, int);
STDAPI_(int ) CeGetClassName (HWND, LPWSTR, int);
STDAPI_(VOID ) CeGlobalMemoryStatus (LPMEMORYSTATUS);
STDAPI_(BOOL ) CeGetSystemPowerStatusEx(PSYSTEM_POWER_STATUS_EX, BOOL);
STDAPI_(DWORD ) CeGetTempPath (DWORD, LPWSTR);
STDAPI_(DWORD ) CeGetSpecialFolderPath(int, DWORD, LPWSTR);
STDAPI_(HANDLE) CeFindFirstDatabaseEx (PCEGUID, DWORD);
STDAPI_(CEOID ) CeFindNextDatabaseEx (HANDLE, PCEGUID);
STDAPI_(CEOID ) CeCreateDatabaseEx (PCEGUID, CEDBASEINFO*);
STDAPI_(BOOL ) CeSetDatabaseInfoEx (PCEGUID, CEOID, CEDBASEINFO*);
STDAPI_(HANDLE) CeOpenDatabaseEx (PCEGUID, PCEOID, LPWSTR, CEPROPID, DWORD, CENOTIFYREQUEST *);
STDAPI_(BOOL ) CeDeleteDatabaseEx (PCEGUID, CEOID);
STDAPI_(CEOID ) CeReadRecordPropsEx (HANDLE, DWORD, LPWORD, CEPROPID*, LPBYTE*, LPDWORD, HANDLE);
STDAPI_(CEOID ) CeWriteRecordProps (HANDLE, CEOID, WORD, CEPROPVAL*);
STDAPI_(BOOL ) CeMountDBVol (PCEGUID, LPWSTR, DWORD);
STDAPI_(BOOL ) CeUnmountDBVol (PCEGUID);
STDAPI_(BOOL ) CeFlushDBVol (PCEGUID);
STDAPI_(BOOL ) CeEnumDBVolumes (PCEGUID, LPWSTR, DWORD);
STDAPI_(BOOL ) CeOidGetInfoEx (PCEGUID, CEOID, CEOIDINFO*);
STDAPI CeSyncStart (LPCWSTR);
STDAPI CeSyncStop ();
STDAPI_(BOOL ) CeQueryInstructionSet (DWORD, LPDWORD);
STDAPI_(BOOL ) CeGetDiskFreeSpaceEx (LPCWSTR, ULARGE_INTEGER *, ULARGE_INTEGER *, ULARGE_INTEGER *);
#endif // #ifndef UNDER_CE
#ifndef NO_APIMAP
#include <ceapimap.h>
#endif
#ifdef CONN_INTERNAL
#include <prapi.h> // internal defines
#endif
#endif // #ifndef RAPI_H

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,445 @@
// *************************************************************************
// rapitypes.h
//
// Copyright 2002 Microsoft Corporation, All Rights Reserved
//
// Typedefs common to public and private RAPI idl.
//
// ***************************************************************************
#pragma once
#ifdef MIDL_ONLY
typedef BYTE far * LPBYTE;
#define STDAPICALLTYPE __stdcall
#endif // MIDL_ONLY
//
// The Windows CE WIN32_FIND_DATA structure differs from the
// Windows WIN32_FIND_DATA stucture so we copy the Windows CE
// definition to here so that both sides match.
//
#define MAX_PATH 260
typedef struct CE_FIND_DATA
{
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD dwOID;
WCHAR cFileName[MAX_PATH];
} CE_FIND_DATA;
typedef CE_FIND_DATA* LPCE_FIND_DATA;
typedef CE_FIND_DATA** LPLPCE_FIND_DATA;
//
// These are flags for CeFindAllFiles
//
#define FAF_ATTRIBUTES ((DWORD) 0x01)
#define FAF_CREATION_TIME ((DWORD) 0x02)
#define FAF_LASTACCESS_TIME ((DWORD) 0x04)
#define FAF_LASTWRITE_TIME ((DWORD) 0x08)
#define FAF_SIZE_HIGH ((DWORD) 0x10)
#define FAF_SIZE_LOW ((DWORD) 0x20)
#define FAF_OID ((DWORD) 0x40)
#define FAF_NAME ((DWORD) 0x80)
#define FAF_FLAG_COUNT ((UINT) 8)
#define FAF_ATTRIB_CHILDREN ((DWORD) 0x01000)
#define FAF_ATTRIB_NO_HIDDEN ((DWORD) 0x02000)
#define FAF_FOLDERS_ONLY ((DWORD) 0x04000)
#define FAF_NO_HIDDEN_SYS_ROMMODULES ((DWORD) 0x08000)
#define FAF_GETTARGET ((DWORD) 0x10000)
#define FAD_OID ((WORD) 0x01)
#define FAD_FLAGS ((WORD) 0x02)
#define FAD_NAME ((WORD) 0x04)
#define FAD_TYPE ((WORD) 0x08)
#define FAD_NUM_RECORDS ((WORD) 0x10)
#define FAD_NUM_SORT_ORDER ((WORD) 0x20)
#define FAD_SIZE ((WORD) 0x40)
#define FAD_LAST_MODIFIED ((WORD) 0x80)
#define FAD_SORT_SPECS ((WORD) 0x100)
#define FAD_FLAG_COUNT ((UINT) 9)
#ifndef FILE_ATTRIBUTE_INROM
#define FILE_ATTRIBUTE_INROM 0x00000040
#endif
#ifndef FILE_ATTRIBUTE_ROMSTATICREF
#define FILE_ATTRIBUTE_ROMSTATICREF 0x00001000
#endif
#ifndef FILE_ATTRIBUTE_ROMMODULE
#define FILE_ATTRIBUTE_ROMMODULE 0x00002000
#endif
//
// The following is not a standard Windows CE File Attribute.
//
#ifndef FILE_ATTRIBUTE_HAS_CHILDREN
#define FILE_ATTRIBUTE_HAS_CHILDREN 0x00010000
#endif
#ifndef FILE_ATTRIBUTE_SHORTCUT
#define FILE_ATTRIBUTE_SHORTCUT 0x00020000
#endif
typedef enum RAPISTREAMFLAG
{
STREAM_TIMEOUT_READ
} RAPISTREAMFLAG;
// forward define
#ifdef MIDL_ONLY
interface IRAPIStream;
#else
typedef struct IRAPIStream IRAPIStream;
#endif
// RAPI extension on Windows CE (e.g., MyFunctionFOO) called via CeRapiInvoke should be declared as:
// EXTERN_C RAPIEXT MyFunctionFOO;
typedef HRESULT (STDAPICALLTYPE RAPIEXT)(
DWORD cbInput, // [IN]
BYTE * pInput, // [IN]
DWORD * pcbOutput, // [OUT]
BYTE ** ppOutput, // [OUT]
IRAPIStream * pIRAPIStream // [IN]
);
//
// The following definitions are for the client side only,
// because they are already defined on Windows CE.
//
#ifndef UNDER_CE
#include <stddef.h>
typedef struct STORE_INFORMATION
{
DWORD dwStoreSize;
DWORD dwFreeSize;
} STORE_INFORMATION;
typedef STORE_INFORMATION * LPSTORE_INFORMATION;
typedef DWORD CEPROPID;
typedef CEPROPID * PCEPROPID;
#define TypeFromPropID(propid) LOWORD(propid)
typedef DWORD CEOID;
typedef CEOID *PCEOID;
typedef struct CEGUID
{
DWORD Data1;
DWORD Data2;
DWORD Data3;
DWORD Data4;
} CEGUID;
typedef CEGUID * PCEGUID;
typedef struct CENOTIFICATION {
DWORD dwSize;
DWORD dwParam;
UINT uType;
CEGUID guid;
CEOID oid;
CEOID oidParent;
} CENOTIFICATION;
#define CEDB_EXNOTIFICATION 0x00000001
typedef struct CENOTIFYREQUEST {
DWORD dwSize;
HWND hwnd;
DWORD dwFlags;
HANDLE hHeap;
DWORD dwParam;
} CENOTIFYREQUEST;
typedef CENOTIFYREQUEST * PCENOTIFYREQUEST;
typedef struct CEFILEINFO
{
DWORD dwAttributes;
CEOID oidParent;
WCHAR szFileName[MAX_PATH];
FILETIME ftLastChanged;
DWORD dwLength;
} CEFILEINFO;
typedef struct CEDIRINFO {
DWORD dwAttributes;
CEOID oidParent;
WCHAR szDirName[MAX_PATH];
} CEDIRINFO;
typedef struct CERECORDINFO {
CEOID oidParent;
} CERECORDINFO;
#define CEDB_SORT_DESCENDING 0x00000001
#define CEDB_SORT_CASEINSENSITIVE 0x00000002
#define CEDB_SORT_UNKNOWNFIRST 0x00000004
#define CEDB_SORT_GENERICORDER 0x00000008
typedef struct SORTORDERSPEC {
CEPROPID propid;
DWORD dwFlags;
} SORTORDERSPEC;
#define CEDB_MAXDBASENAMELEN 32
#define CEDB_MAXDBASENAMELEN 32
#define CEDB_MAXSORTORDER 4
#define CEDB_MAXSORTORDER 4
#define CEDB_VALIDNAME 0x0001
#define CEDB_VALIDTYPE 0x0002
#define CEDB_VALIDSORTSPEC 0x0004
#define CEDB_VALIDMODTIME 0x0008
#define CEDB_VALIDDBFLAGS 0x0010
#define CEDB_VALIDCREATE (CEDB_VALIDNAME|CEDB_VALIDTYPE|CEDB_VALIDSORTSPEC|CEDB_VALIDDBFLAGS)
#define CEDB_NOCOMPRESS 0x00010000
typedef struct CEDBASEINFO
{
DWORD dwFlags;
WCHAR szDbaseName[CEDB_MAXDBASENAMELEN];
DWORD dwDbaseType;
WORD wNumRecords;
WORD wNumSortOrder;
DWORD dwSize;
FILETIME ftLastModified;
SORTORDERSPEC rgSortSpecs[CEDB_MAXSORTORDER];
} CEDBASEINFO;
typedef struct CEDB_FIND_DATA {
CEOID OidDb;
CEDBASEINFO DbInfo;
} CEDB_FIND_DATA;
typedef CEDB_FIND_DATA * LPCEDB_FIND_DATA;
typedef CEDB_FIND_DATA ** LPLPCEDB_FIND_DATA;
#define OBJTYPE_INVALID 0
#define OBJTYPE_FILE 1
#define OBJTYPE_DIRECTORY 2
#define OBJTYPE_DATABASE 3
#define OBJTYPE_RECORD 4
typedef struct CEOIDINFO
{
WORD wObjType;
WORD wPad;
union
{
CEFILEINFO infFile;
CEDIRINFO infDirectory;
CEDBASEINFO infDatabase;
CERECORDINFO infRecord;
};
} CEOIDINFO;
#define CEDB_AUTOINCREMENT 0x00000001
#define CEDB_SEEK_CEOID 0x00000001
#define CEDB_SEEK_BEGINNING 0x00000002
#define CEDB_SEEK_END 0x00000004
#define CEDB_SEEK_CURRENT 0x00000008
#define CEDB_SEEK_VALUESMALLER 0x00000010
#define CEDB_SEEK_VALUEFIRSTEQUAL 0x00000020
#define CEDB_SEEK_VALUEGREATER 0x00000040
#define CEDB_SEEK_VALUENEXTEQUAL 0x00000080
typedef struct CEBLOB{
DWORD dwCount;
LPBYTE lpb;
} CEBLOB;
#define CEVT_I2 2
#define CEVT_UI2 18
#define CEVT_I4 3
#define CEVT_UI4 19
#define CEVT_FILETIME 64
#define CEVT_LPWSTR 31
#define CEVT_BLOB 65
#define CEVT_BOOL 11
#define CEVT_R8 5
typedef union CEVALUNION {
short iVal;
USHORT uiVal;
long lVal;
ULONG ulVal;
FILETIME filetime;
LPWSTR lpwstr;
CEBLOB blob;
BOOL boolVal;
double dblVal;
} CEVALUNION;
#define CEDB_PROPNOTFOUND 0x0100
#define CEDB_PROPDELETE 0x0200
typedef struct CEPROPVAL {
CEPROPID propid;
WORD wLenData;
WORD wFlags;
CEVALUNION val;
} CEPROPVAL;
typedef CEPROPVAL * PCEPROPVAL;
#define CEDB_MAXDATABLOCKSIZE 4092
#define CEDB_MAXPROPDATASIZE (CEDB_MAXDATABLOCKSIZE*16)
#define CEDB_MAXRECORDSIZE (128*1024)
#define CEDB_ALLOWREALLOC 0x00000001
#define CREATE_SYSTEMGUID(pguid) (memset((pguid), 0, sizeof(CEGUID)))
#define CREATE_INVALIDGUID(pguid) (memset((pguid), -1, sizeof(CEGUID)))
#define CHECK_SYSTEMGUID(pguid) !((pguid)->Data1|(pguid)->Data2|(pguid)->Data3|(pguid)->Data4)
#define CHECK_INVALIDGUID(pguid) !~((pguid)->Data1&(pguid)->Data2&(pguid)->Data3&(pguid)->Data4)
#define SYSMEM_CHANGED 0
#define SYSMEM_MUSTREBOOT 1
#define SYSMEM_REBOOTPENDING 2
#define SYSMEM_FAILED 3
typedef struct CEOSVERSIONINFO {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR szCSDVersion[ 128 ];
} CEOSVERSIONINFO;
typedef CEOSVERSIONINFO * LPCEOSVERSIONINFO;
#define AC_LINE_OFFLINE 0x00
#define AC_LINE_ONLINE 0x01
#define AC_LINE_BACKUP_POWER 0x02
#define AC_LINE_UNKNOWN 0xFF
#define BATTERY_FLAG_HIGH 0x01
#define BATTERY_FLAG_LOW 0x02
#define BATTERY_FLAG_CRITICAL 0x04
#define BATTERY_FLAG_CHARGING 0x08
#define BATTERY_FLAG_NO_BATTERY 0x80
#define BATTERY_FLAG_UNKNOWN 0xFF
#define BATTERY_PERCENTAGE_UNKNOWN 0xFF
#define BATTERY_LIFE_UNKNOWN 0xFFFFFFFF
typedef struct SYSTEM_POWER_STATUS_EX{
BYTE ACLineStatus;
BYTE BatteryFlag;
BYTE BatteryLifePercent;
BYTE Reserved1;
DWORD BatteryLifeTime;
DWORD BatteryFullLifeTime;
BYTE Reserved2;
BYTE BackupBatteryFlag;
BYTE BackupBatteryLifePercent;
BYTE Reserved3;
DWORD BackupBatteryLifeTime;
DWORD BackupBatteryFullLifeTime;
} SYSTEM_POWER_STATUS_EX;
typedef SYSTEM_POWER_STATUS_EX * PSYSTEM_POWER_STATUS_EX;
typedef SYSTEM_POWER_STATUS_EX * LPSYSTEM_POWER_STATUS_EX;
//
// MessageId: CERAPI_E_ALREADYINITIALIZED
//
// CeRapiInit(Ex) has already been successfully called
//
#define CERAPI_E_ALREADYINITIALIZED 0x80041001
typedef struct RAPIINIT
{
DWORD cbSize;
HANDLE heRapiInit;
HRESULT hrRapiInit;
} RAPIINIT;
//
// Instruction set definitions for CeQueryInstructionSet()
//
// PROCESSOR_ARCHITECTURE_x are already defined in desktop winnt.h
// Here we include the CE specific definitions from CE winnt.h
//
#define PROCESSOR_INSTRUCTION_CODE(arch, core, feature) \
((arch) << 24 | (core) << 16 | (feature))
#define PROCESSOR_X86_32BIT_CORE 1
#define PROCESSOR_MIPS16_CORE 1
#define PROCESSOR_MIPSII_CORE 2
#define PROCESSOR_MIPSIV_CORE 3
#define PROCESSOR_HITACHI_SH3_CORE 1
#define PROCESSOR_HITACHI_SH4_CORE 2
#define PROCESSOR_ARM_V4_CORE 1
#define PROCESSOR_ARM_V4I_CORE 2
#define PROCESSOR_ARM_V4T_CORE 3
#define PROCESSOR_FEATURE_NOFP 0
#define PROCESSOR_FEATURE_FP 1
#define PROCESSOR_FEATURE_DSP PROCESSOR_FEATURE_FP
#define PROCESSOR_QUERY_INSTRUCTION PROCESSOR_INSTRUCTION_CODE(0,0,0)
#define PROCESSOR_X86_32BIT_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_INTEL, PROCESSOR_X86_32BIT_CORE, PROCESSOR_FEATURE_FP)
#define PROCESSOR_MIPS_MIPS16_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_MIPS, PROCESSOR_MIPS16_CORE, PROCESSOR_FEATURE_NOFP)
#define PROCESSOR_MIPS_MIPSII_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_MIPS, PROCESSOR_MIPSII_CORE, PROCESSOR_FEATURE_NOFP)
#define PROCESSOR_MIPS_MIPSIIFP_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_MIPS, PROCESSOR_MIPSII_CORE, PROCESSOR_FEATURE_FP)
#define PROCESSOR_MIPS_MIPSIV_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_MIPS, PROCESSOR_MIPSIV_CORE, PROCESSOR_FEATURE_NOFP)
#define PROCESSOR_MIPS_MIPSIVFP_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_MIPS, PROCESSOR_MIPSIV_CORE, PROCESSOR_FEATURE_FP)
#define PROCESSOR_HITACHI_SH3_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_SHX, PROCESSOR_HITACHI_SH3_CORE, PROCESSOR_FEATURE_NOFP)
#define PROCESSOR_HITACHI_SH3DSP_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_SHX, PROCESSOR_HITACHI_SH3_CORE, PROCESSOR_FEATURE_DSP)
#define PROCESSOR_HITACHI_SH4_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_SHX, PROCESSOR_HITACHI_SH4_CORE, PROCESSOR_FEATURE_FP)
#define PROCESSOR_ARM_V4_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_ARM, PROCESSOR_ARM_V4_CORE, PROCESSOR_FEATURE_NOFP)
#define PROCESSOR_ARM_V4FP_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_ARM, PROCESSOR_ARM_V4_CORE, PROCESSOR_FEATURE_FP)
#define PROCESSOR_ARM_V4I_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_ARM, PROCESSOR_ARM_V4I_CORE, PROCESSOR_FEATURE_NOFP)
#define PROCESSOR_ARM_V4IFP_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_ARM, PROCESSOR_ARM_V4I_CORE, PROCESSOR_FEATURE_FP)
#define PROCESSOR_ARM_V4T_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_ARM, PROCESSOR_ARM_V4T_CORE, PROCESSOR_FEATURE_NOFP)
#define PROCESSOR_ARM_V4TFP_INSTRUCTION \
PROCESSOR_INSTRUCTION_CODE(PROCESSOR_ARCHITECTURE_ARM, PROCESSOR_ARM_V4T_CORE, PROCESSOR_FEATURE_FP)
#endif // !UNDER_CE

View file

@ -0,0 +1,248 @@
// ***************************************************************************
// rapitypes2.h
//
// Copyright 2003 Microsoft Corporation, All Rights Reserved
//
// Types needed for RAPI2.
//
// ***************************************************************************
#pragma once
#ifdef MIDL_ONLY
#include <basetsd.h>
typedef struct OVERLAPPED {
ULONG_PTR Internal;
ULONG_PTR InternalHigh;
union UNION_OFFSET_POINTER{
struct OFFSET{
DWORD Offset;
DWORD OffsetHigh;
} OFFSET;
PVOID Pointer;
} UNION_OFFSET_POINTER;
HANDLE hEvent;
} OVERLAPPED;
typedef OVERLAPPED * LPOVERLAPPED;
#define CONST const
typedef CONST void far *LPCVOID;
typedef LONG *PLONG;
typedef struct STARTUPINFOA {
DWORD cb;
LPSTR lpReserved;
LPSTR lpDesktop;
LPSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
LPBYTE lpReserved2;
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;
} STARTUPINFOA;
typedef STARTUPINFOA * LPSTARTUPINFOA;
typedef struct STARTUPINFOW {
DWORD cb;
LPWSTR lpReserved;
LPWSTR lpDesktop;
LPWSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
LPBYTE lpReserved2;
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;
} STARTUPINFOW;
typedef STARTUPINFOW * LPSTARTUPINFOW;
#ifdef UNICODE
typedef STARTUPINFOW STARTUPINFO;
typedef LPSTARTUPINFOW LPSTARTUPINFO;
#else
typedef STARTUPINFOA STARTUPINFO;
typedef LPSTARTUPINFOA LPSTARTUPINFO;
#endif // UNICODE
typedef struct PROCESS_INFORMATION {
HANDLE hProcess;
HANDLE hThread;
DWORD dwProcessId;
DWORD dwThreadId;
} PROCESS_INFORMATION;
typedef PROCESS_INFORMATION * PPROCESS_INFORMATION;
typedef PROCESS_INFORMATION * LPPROCESS_INFORMATION;
typedef DWORD ACCESS_MASK;
typedef ACCESS_MASK REGSAM;
typedef HKEY *PHKEY;
typedef struct SYSTEM_INFO {
union UNION_OEMID_PROCESSOR_INFO{
DWORD dwOemId; // Obsolete field...do not use
struct PROCESSOR_INFO{
WORD wProcessorArchitecture;
WORD wReserved;
} PROCESSOR_INFO;
} UNION_OEMID_PROCESSOR_INFO;
DWORD dwPageSize;
LPVOID lpMinimumApplicationAddress;
LPVOID lpMaximumApplicationAddress;
DWORD_PTR dwActiveProcessorMask;
DWORD dwNumberOfProcessors;
DWORD dwProcessorType;
DWORD dwAllocationGranularity;
WORD wProcessorLevel;
WORD wProcessorRevision;
} SYSTEM_INFO;
typedef SYSTEM_INFO * LPSYSTEM_INFO;
typedef struct MEMORYSTATUS {
DWORD dwLength;
DWORD dwMemoryLoad;
SIZE_T dwTotalPhys;
SIZE_T dwAvailPhys;
SIZE_T dwTotalPageFile;
SIZE_T dwAvailPageFile;
SIZE_T dwTotalVirtual;
SIZE_T dwAvailVirtual;
} MEMORYSTATUS;
typedef MEMORYSTATUS * LPMEMORYSTATUS;
#define _SS_MAXSIZE 128 // Maximum size.
#define _SS_ALIGNSIZE (sizeof(__int64)) // Desired alignment.
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short))
#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) + _SS_PAD1SIZE \
+ _SS_ALIGNSIZE))
/*
typedef struct sockaddr_storage {
short ss_family; // Address family.
char __ss_pad1[_SS_PAD1SIZE]; // 6 byte pad, this is to make
// implementation specific pad up to
// alignment field that follows explicit
// in the data structure.
__int64 __ss_align; // Field to force desired structure.
char __ss_pad2[_SS_PAD2SIZE]; // 112 byte pad to achieve desired size;
// _SS_MAXSIZE value minus size of
// ss_family, __ss_pad1, and
// __ss_align fields is 112.
} sockaddr_storage ;
typedef struct sockaddr_storage SOCKADDR_STORAGE;
*/
#endif // MIDL_ONLY
// end gross struct copy hack (everything after this is previously hacked from CE stuff that doesn't exist on desktop, so leave it as is).
//
// DEVICEID structure
//
typedef GUID RAPIDEVICEID;
#define RAPIDEVICEID_BACKCOMPAT GUID_NULL // device id for older devices
#ifndef UNDER_CE
// this is defined in CE's pwinuser.h, so we only want it for desktop
typedef struct {
DWORD dwMajor;
DWORD dwMinor;
} PLATFORMVERSION;
#endif
//
// struct to hold additional platforms and their versions.
//
#define MAX_SUB_PLATFORMS 6
typedef struct RAPI_DEVICE_PLATFORM
{
BSTR bstrName;
DWORD dwMajor;
DWORD dwMinor;
} RAPI_DEVICE_PLATFORM;
//
// RAPI_DEVICEINFO
//
typedef struct RAPI_DEVICEINFO
{
RAPIDEVICEID DeviceId;
DWORD dwOsVersionMajor;
DWORD dwOsVersionMinor;
BSTR bstrName;
BSTR bstrPlatform;
} RAPI_DEVICEINFO;
#define FreeDeviceInfoData(pDevInfo) \
do \
{ \
SysFreeString((pDevInfo)->bstrName); \
SysFreeString((pDevInfo)->bstrPlatform); \
} while (0,0)
#ifndef MIDL_ONLY
#include "winsock2.h"
#endif
//
// RAPI_DEVICESTATUS
//
typedef enum RAPI_DEVICESTATUS
{
RAPI_DEVICE_DISCONNECTED = 0,
RAPI_DEVICE_CONNECTED = 1,
} RAPI_DEVICESTATUS;
//
// op codes for IRAPIDesktop funcs
//
typedef enum RAPI_GETDEVICEOPCODE
{
RAPI_GETDEVICE_NONBLOCKING,
RAPI_GETDEVICE_BLOCKING
} RAPI_GETDEVICEOPCODE;
//
// Connected type codes
//
typedef enum RAPI_CONNECTIONTYPE
{
RAPI_CONNECTION_USB = 0,
RAPI_CONNECTION_IR = 1,
RAPI_CONNECTION_SERIAL = 2,
RAPI_CONNECTION_NETWORK = 3,
} RAPI_CONNECTIONTYPE;
typedef struct RAPI_CONNECTIONINFO {
SOCKADDR_STORAGE ipaddr;
SOCKADDR_STORAGE hostIpaddr;
RAPI_CONNECTIONTYPE connectionType;
} RAPI_CONNECTIONINFO;

View file

@ -0,0 +1,220 @@
//#define PLUGIN_NAME "Nullsoft ActiveSync Plug-in"
#define PLUGIN_VERSION L"0.25"
#include "ASDevice.h"
int init();
void quit();
intptr_t MessageProc(int msg, intptr_t param1, intptr_t param2, intptr_t param3);
extern PMPDevicePlugin plugin = {PMPHDR_VER,0,init,quit,MessageProc};
static HANDLE killEvent=0, hThread=0;
static DWORD WINAPI ThreadFunc(LPVOID lpParam);
IRAPIDesktop *pIRapiDesktop = NULL;
// wasabi based services for localisation support
api_language *WASABI_API_LNG = 0;
HINSTANCE WASABI_API_LNG_HINST = 0, WASABI_API_ORIG_HINST = 0;
std::vector<ASDevice*> devices;
std::vector<ejectedDevice*> ejected;
static RAPIDEVICEID lastDevId;
class MyRAPISink : public IRAPISink {
public:
virtual HRESULT STDMETHODCALLTYPE OnDeviceConnected(IRAPIDevice *pIDevice) {
RAPI_DEVICEINFO devInfo;
if(!SUCCEEDED(pIDevice->GetDeviceInfo(&devInfo))) return S_OK;
SysFreeString(devInfo.bstrName);
SysFreeString(devInfo.bstrPlatform);
EnterCriticalSection(&cs);
lastDevId = devInfo.DeviceId;
for(unsigned int i=0; i<ejected.size(); i++) {
if(devInfo.DeviceId == ejected[i]->id) {
ejected[i]->marked=true;
LeaveCriticalSection(&cs);
return S_OK;
}
}
for(unsigned int i=0; i<devices.size(); i++) {
if(devInfo.DeviceId == devices[i]->devInfo.DeviceId || devices[i]->pIDevice == pIDevice) {
LeaveCriticalSection(&cs);
return S_OK;
}
}
IRAPISession *pISession = NULL;
if (SUCCEEDED(pIDevice->CreateSession(&pISession))) {
if (SUCCEEDED(pISession->CeRapiInit())) devices.push_back(new ASDevice(pIDevice,pISession));
else pISession->Release();
}
LeaveCriticalSection(&cs);
return S_OK;
}
virtual HRESULT STDMETHODCALLTYPE OnDeviceDisconnected(IRAPIDevice *pIDevice) {
EnterCriticalSection(&cs);
RAPI_DEVICEINFO devInfo;
if(!SUCCEEDED(pIDevice->GetDeviceInfo(&devInfo))) return S_OK;
for(unsigned int i=0; i<devices.size(); i++) {
if(devInfo.DeviceId == devices[i]->devInfo.DeviceId || devices[i]->pIDevice == pIDevice) {
SendMessage(plugin.hwndPortablesParent,WM_PMP_IPC,(intptr_t)devices[i],PMP_IPC_DEVICEDISCONNECTED);
delete devices[i];
}
}
SysFreeString(devInfo.bstrName);
SysFreeString(devInfo.bstrPlatform);
LeaveCriticalSection(&cs);
return S_OK;
}
DWORD RAPISinkContext;
CRITICAL_SECTION cs;
ULONG refs;
MyRAPISink() {refs=1; InitializeCriticalSection(&cs);}
~MyRAPISink() { DeleteCriticalSection(&cs); }
#define IMPLEMENTS(ifc) if (riid == IID_ ## ifc) { ++refs; *ppvObject = static_cast<ifc *>(this); return S_OK; }
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid,void __RPC_FAR *__RPC_FAR *ppvObject) {
IMPLEMENTS(IRAPISink);
IMPLEMENTS(IUnknown);
*ppvObject = NULL;
return E_NOINTERFACE;
}
virtual ULONG STDMETHODCALLTYPE AddRef() { return ++refs; }
virtual ULONG STDMETHODCALLTYPE Release() { int x = --refs; if(!x) delete this; return x; }
#undef IMPLEMENTS
};
MyRAPISink *pMyRapiSink=NULL;
int init() {
CoInitializeEx(NULL, COINIT_MULTITHREADED);
HRESULT hr = CoCreateInstance(CLSID_RAPI,NULL,CLSCTX_INPROC_SERVER,IID_IRAPIDesktop,(void**)&pIRapiDesktop);
if(!SUCCEEDED(hr) || !pIRapiDesktop) return -1; // no activesync on this computer!
// loader so that we can get the localisation service api for use
waServiceFactory *sf = plugin.service->service_getServiceByGuid(languageApiGUID);
if (sf) WASABI_API_LNG = reinterpret_cast<api_language*>(sf->getInterface());
// need to have this initialised before we try to do anything with localisation features
WASABI_API_START_LANG(plugin.hDllInstance,PmpACTIVESYNCLangGUID);
static wchar_t szDescription[256];
swprintf(szDescription, ARRAYSIZE(szDescription),
WASABI_API_LNGSTRINGW(IDS_NULLSOFT_ACTIVESYNC_PLUGIN), PLUGIN_VERSION);
plugin.description = szDescription;
killEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
DWORD dwThreadId;
hThread = CreateThread(NULL, 0, ThreadFunc, NULL, 0, &dwThreadId);
return 0;
}
static void enumDevices() {
// find all the currently connected devices
IRAPIEnumDevices* pIRapiEnumDevices = NULL;
HRESULT hr = pIRapiDesktop->EnumDevices(&pIRapiEnumDevices);
for (unsigned int i = 0; i < ejected.size(); i++) ejected[i]->marked = false;
while (SUCCEEDED(hr) && pIRapiEnumDevices) {
IRAPIDevice* pIRapiDevice = NULL;
hr = pIRapiEnumDevices->Next(&pIRapiDevice);
if (SUCCEEDED(hr) && pIRapiDevice) {
pMyRapiSink->OnDeviceConnected(pIRapiDevice);
pIRapiDevice->Release();
}
else {
pIRapiEnumDevices->Release();
pIRapiEnumDevices = NULL;
}
}
//for (unsigned int i = 0; i < ejected.size(); i++)
//{
// if (!ejected[i]->marked)
// {
// free(ejected[i]);
// ejected.eraseindex(i);
// }
//}
auto it = ejected.begin();
while (it != ejected.end())
{
ejectedDevice* dev = *it;
if (!dev->marked)
{
free(dev);
it = ejected.erase(it);
}
else
{
it++;
}
}
}
static void init2() {
// set up device connection/disconnection notifications
pMyRapiSink = new MyRAPISink();
pIRapiDesktop->Advise(pMyRapiSink,(DWORD_PTR*)&pMyRapiSink->RAPISinkContext);
// find currently attached devices
enumDevices();
}
void quit() {
SetEvent(killEvent);
if (hThread) {
for(;;) {
int val = WaitForSingleObjectEx(hThread,15000,TRUE);
if(val == WAIT_OBJECT_0) { CloseHandle(hThread); break; }
else if(val == WAIT_TIMEOUT) { TerminateThread(hThread, 0); break; }
else continue;
}
}
CloseHandle(killEvent);
pIRapiDesktop->UnAdvise(pMyRapiSink->RAPISinkContext);
pIRapiDesktop->Release();
pMyRapiSink->Release();
CoUninitialize();
for(unsigned int i=0; i<ejected.size(); i++) free(ejected[i]);
}
static DWORD WINAPI ThreadFunc(LPVOID lpParam) {
CoInitializeEx(0,COINIT_MULTITHREADED);
init2();
while (WaitForSingleObjectEx(killEvent,5000,TRUE) != WAIT_OBJECT_0) {
// FUCKO: For some reason I'm not getting the device connected notifications, so lets just enum for devices on a regular basis.
enumDevices();
}
CoUninitialize();
return 0;
}
intptr_t MessageProc(int msg, intptr_t param1, intptr_t param2, intptr_t param3) {
if (msg == PMP_NO_CONFIG)
return TRUE;
return FALSE;
}
extern "C" {
__declspec( dllexport ) PMPDevicePlugin * winampGetPMPDevicePlugin(){return &plugin;}
__declspec( dllexport ) int winampUninstallPlugin(HINSTANCE hDllInst, HWND hwndDlg, int param) {
int i = (int)devices.size();
while(i-- > 0) devices[i]->Close();
return PMP_PLUGIN_UNINSTALL_NOW;
}
};

View file

@ -0,0 +1,116 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#include ""version.rc2""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// RCDATA
//
IDR_ACTIVESYNC_ICON RCDATA ".\\resources\\activeSyncIcon.png"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_CONFIG DIALOGEX 0, 0, 264, 226
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_SYSMENU
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
GROUPBOX "Folders",IDC_STATIC,4,3,255,83
LTEXT "Music Folder",IDC_STATIC,8,16,40,8
EDITTEXT IDC_FOLDER_MUSIC,56,14,197,14,ES_AUTOHSCROLL
LTEXT "Video Folder",IDC_STATIC,8,32,40,8
EDITTEXT IDC_FOLDER_VIDEO,56,30,197,14,ES_AUTOHSCROLL
LTEXT "Playlist Folder",IDC_STATIC,8,49,45,8
EDITTEXT IDC_FOLDER_PLAYLIST,56,46,197,14,ES_AUTOHSCROLL
PUSHBUTTON "Rescan folders",IDC_RESCAN,7,66,56,14
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_NULLSOFT_ACTIVESYNC_PLUGIN "Nullsoft ActiveSync Plug-in v%s"
65535 "{B81F32B8-4AA4-4eba-8798-95F13812F638}"
END
STRINGTABLE
BEGIN
IDS_LOADING "Loading %s..."
IDS_TRANSFERRING "Transferring..."
IDS_CANNOT_OPEN_LOCAL_FILE "Cannot open local file"
IDS_CANNOT_OPEN_FILE_ON_DEVICE "Cannot open file on device"
IDS_ERROR_WRITING_FILE "Error writing to file"
IDS_TRANSFERRING_PERCENT "Transferring %d%%"
IDS_DONE "Done"
IDS_CANNOT_OPEN_DESTINATION "Cannot open destination file"
IDS_ADVANCED "Advanced"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "version.rc2"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -0,0 +1,18 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmp_activesync", "pmp_activesync.vcproj", "{60D71BB7-D741-444E-99ED-7249A716B99F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{60D71BB7-D741-444E-99ED-7249A716B99F}.Debug|Win32.ActiveCfg = Debug|Win32
{60D71BB7-D741-444E-99ED-7249A716B99F}.Release|Win32.ActiveCfg = Release|Win32
{60D71BB7-D741-444E-99ED-7249A716B99F}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,357 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{60D71BB7-D741-444E-99ED-7249A716B99F}</ProjectGuid>
<RootNamespace>pmp_activesync</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>17.0.32505.173</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>true</GenerateManifest>
<IncludePath>$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>true</GenerateManifest>
<IncludePath>$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Label="Vcpkg">
<VcpkgEnabled>false</VcpkgEnabled>
</PropertyGroup>
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<VcpkgConfiguration>Debug</VcpkgConfiguration>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>$(IntDir)$(TargetName).tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\replicant;activesync\Inc;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;_USRDLL;ML_ex_EXPORTS;WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x040c</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>rapiuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>activesync\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<GenerateMapFile>false</GenerateMapFile>
<MapExports>false</MapExports>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<MapFileName>$(IntDir)$(TargetName).map</MapFileName>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<IgnoreSpecificDefaultLibraries>libc.lib;msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
<PostBuildEvent>
<Command>xcopy /Y /D $(OutDir)*.dll ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\
xcopy /Y /D $(IntDir)*.pdb ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>$(IntDir)$(TargetName).tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\replicant;activesync\Inc;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;_USRDLL;ML_ex_EXPORTS;WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x040c</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>rapiuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>activesync\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<GenerateMapFile>false</GenerateMapFile>
<MapExports>false</MapExports>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<MapFileName>$(IntDir)$(TargetName).map</MapFileName>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<IgnoreSpecificDefaultLibraries>libc.lib;msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
<PostBuildEvent>
<Command>xcopy /Y /D $(OutDir)*.dll ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\
xcopy /Y /D $(IntDir)*.pdb ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>$(IntDir)$(TargetName).tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
<Optimization>MinSpace</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\..\replicant;activesync\Inc;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;_USRDLL;ML_ex_EXPORTS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<PrecompiledHeader />
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x040c</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>rapiuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>activesync\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc.lib;msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<MapFileName>$(IntDir)$(TargetName).map</MapFileName>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<PostBuildEvent>
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>$(IntDir)$(TargetName).tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MinSpace</Optimization>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\..\..\replicant;activesync\Inc;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;_USRDLL;ML_ex_EXPORTS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>$(IntDir)$(TargetName).pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)</ObjectFileName>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x040c</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>rapiuuid.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>activesync\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc.lib;msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<MapFileName>$(IntDir)$(TargetName).map</MapFileName>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<PostBuildEvent>
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\General\gen_ml\ml_lib.cpp" />
<ClCompile Include="ASDevice.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\General\gen_ml\ml.h" />
<ClInclude Include="..\..\Library\ml_pmp\pmp.h" />
<ClInclude Include="ASDevice.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<Image Include="resources\activeSyncIcon.png" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="pmp_activesync.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Wasabi\Wasabi.vcxproj">
<Project>{3e0bfa8a-b86a-42e9-a33f-ec294f823f7f}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{b35076f0-5e1b-4df9-baa4-ef63b5b1e046}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{5ed7e868-d2e1-4274-890e-0f94583196e2}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="resources">
<UniqueIdentifier>{194593b8-f700-465e-aa6d-b982a8271c7e}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ASDevice.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\General\gen_ml\ml_lib.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ASDevice.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\General\gen_ml\ml.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\Library\ml_pmp\pmp.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="resources\activeSyncIcon.png">
<Filter>resources</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="pmp_activesync.rc">
<Filter>resources</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View file

@ -0,0 +1,31 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by pmp_activesync.rc
//
#define IDS_LOADING 1
#define IDS_TRANSFERRING 2
#define IDS_CANNOT_OPEN_LOCAL_FILE 3
#define IDS_CANNOT_OPEN_FILE_ON_DEVICE 4
#define IDS_ERROR_WRITING_FILE 5
#define IDS_TRANSFERRING_PERCENT 6
#define IDS_DONE 7
#define IDS_CANNOT_OPEN_DESTINATION 8
#define IDS_ADVANCED 9
#define IDR_ACTIVESYNC_ICON 101
#define IDD_CONFIG 102
#define IDC_FOLDER_MUSIC 1001
#define IDC_FOLDER_PLAYLIST 1002
#define IDC_FOLDER_VIDEO 1003
#define IDC_RESCAN 1004
#define IDS_NULLSOFT_ACTIVESYNC_PLUGIN 65534
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

View file

@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
#include "../../../Winamp/buildType.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,25,0,0
PRODUCTVERSION WINAMP_PRODUCTVER
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Winamp SA"
VALUE "FileDescription", "Winamp Portable Device Plug-in"
VALUE "FileVersion", "0,25,0,0"
VALUE "InternalName", "Nullsoft ActiveSync"
VALUE "LegalCopyright", "Copyright © 2006-2023 Winamp SA"
VALUE "LegalTrademarks", "Nullsoft and Winamp are trademarks of Winamp SA"
VALUE "OriginalFilename", "pmp_activesync.dll"
VALUE "ProductName", "Winamp"
VALUE "ProductVersion", STR_WINAMP_PRODUCTVER
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END