123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606 |
- /*
- * Copyright 2016-2018, 2021 Hugh McMaster
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
- #include "reg_test.h"
- static BOOL write_file(const void *str, DWORD size)
- {
- HANDLE file;
- BOOL ret;
- DWORD written;
- file = CreateFileA("test.reg", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL, NULL);
- ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError());
- if (file == INVALID_HANDLE_VALUE)
- return FALSE;
- ret = WriteFile(file, str, size, &written, NULL);
- ok(ret, "WriteFile failed: %u\n", GetLastError());
- CloseHandle(file);
- return ret;
- }
- BOOL import_reg(const char *file, unsigned line, const char *contents, BOOL unicode, DWORD *rc)
- {
- int lenA;
- BOOL ret;
- lenA = strlen(contents);
- if (unicode)
- {
- int len = MultiByteToWideChar(CP_UTF8, 0, contents, lenA, NULL, 0);
- int size = len * sizeof(WCHAR);
- WCHAR *wstr = HeapAlloc(GetProcessHeap(), 0, size);
- if (!wstr) return FALSE;
- MultiByteToWideChar(CP_UTF8, 0, contents, lenA, wstr, len);
- ret = write_file(wstr, size);
- HeapFree(GetProcessHeap(), 0, wstr);
- }
- else
- ret = write_file(contents, lenA);
- if (!ret) return FALSE;
- run_reg_exe("reg import test.reg", rc);
- ret = DeleteFileA("test.reg");
- lok(ret, "DeleteFile failed: %u\n", GetLastError());
- return ret;
- }
- /* Unit tests */
- static void test_import(void)
- {
- DWORD r, dword = 0x123, type, size;
- char buffer[24];
- HKEY hkey, subkey = NULL;
- LONG err;
- BYTE hex[8];
- delete_tree(HKEY_CURRENT_USER, KEY_BASE);
- verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
- run_reg_exe("reg import", &r);
- ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg import /?", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- run_reg_exe("reg import /h", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- run_reg_exe("reg import -H", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- run_reg_exe("reg import missing.reg", &r);
- ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg import a.reg b.reg", &r);
- ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- /* Test file contents */
- test_import_str("regedit\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_str("regedit4\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_str("REGEDIT", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("REGEDIT\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("REGEDIT4\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str(" REGEDIT4\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("\tREGEDIT4\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("\nREGEDIT4\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_str("AREGEDIT4\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_str("1REGEDIT4\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_str("REGEDIT3\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("REGEDIT5\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("REGEDIT9\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("REGEDIT 4\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("REGEDIT4 FOO\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("REGEDIT4\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- open_key(HKEY_CURRENT_USER, KEY_BASE, KEY_SET_VALUE, &hkey);
- test_import_str("REGEDIT4\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine\"=dword:00000123\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_str("REGEDIT4\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "@=\"Test string\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, NULL, REG_SZ, "Test string", 12, 0);
- test_import_str("REGEDIT3\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test1\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test1");
- test_import_str("regedit4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test2\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test2");
- test_import_str("Regedit4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test3\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test3");
- test_import_str("REGEDIT 4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test4\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test4");
- test_import_str("REGEDIT4FOO\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test5\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test5");
- test_import_str("REGEDIT4 FOO\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test6\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test6");
- test_import_str("REGEDIT5\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test7\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test7");
- test_import_str("REGEDIT9\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test8\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test8");
- test_import_str("Windows Registry Editor Version 4.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test9\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test9");
- test_import_str("Windows Registry Editor Version 5\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test10\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test10");
- test_import_str("WINDOWS REGISTRY EDITOR VERSION 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test11\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test11");
- test_import_str("Windows Registry Editor version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test12\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test12");
- test_import_str("REGEDIT4\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test1\"=\"Value1\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Test1", REG_SZ, "Value1", 7, 0);
- test_import_str("REGEDIT4\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test2\"=\"Value2\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Test2", REG_SZ, "Value2", 7, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test3\"=\"Value3\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Test3", REG_SZ, "Value3", 7, 0);
- test_import_str("Windows Registry Editor Version 4.00\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_str("Windows Registry Editor Version 5.00\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_str("Windows Registry Editor Version 5.00\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test4\"=\"Value4\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Test4", REG_SZ, "Value4", 7, 0);
- test_import_str("Windows Registry Editor Version 5.00\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test5\"=\"Value5\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Test5", REG_SZ, "Value5", 7, 0);
- test_import_str("Windows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test6\"=\"Value6\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Test6", REG_SZ, "Value6", 7, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Line1\"=\"Value1\"\n\n"
- "\"Line2\"=\"Value2\"\n\n\n"
- "\"Line3\"=\"Value3\"\n\n\n\n"
- "\"Line4\"=\"Value4\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Line1", REG_SZ, "Value1", 7, 0);
- verify_reg(hkey, "Line2", REG_SZ, "Value2", 7, 0);
- verify_reg(hkey, "Line3", REG_SZ, "Value3", 7, 0);
- verify_reg(hkey, "Line4", REG_SZ, "Value4", 7, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine1\"=dword:00000782\n\n"
- "\"Wine2\"=\"Test Value\"\n"
- "\"Wine3\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n"
- "#comment\n"
- "@=\"Test\"\n"
- ";comment\n\n"
- "\"Wine4\"=dword:12345678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x782;
- verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine2", REG_SZ, "Test Value", 11, 0);
- verify_reg(hkey, "Wine3", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "", REG_SZ, "Test", 5, 0);
- dword = 0x12345678;
- verify_reg(hkey, "Wine4", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine5\"=\"No newline\"", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine5", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND /* WinXP */),
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine5", REG_SZ, "No newline", 11, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine6\"=dword:00000050\n\n"
- "\"Wine7\"=\"No newline\"", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x50;
- verify_reg(hkey, "Wine6", REG_DWORD, &dword, sizeof(dword), 0);
- err = RegQueryValueExA(hkey, "Wine7", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND /* WinXP */),
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine7", REG_SZ, "No newline", 11, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "#comment\\\n"
- "\"Wine8\"=\"Line 1\"\n"
- ";comment\\\n"
- "\"Wine9\"=\"Line 2\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine8", REG_SZ, "Line 1", 7, 0);
- verify_reg(hkey, "Wine9", REG_SZ, "Line 2", 7, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine10\"=\"Value 1\"#comment\n"
- "\"Wine11\"=\"Value 2\";comment\n"
- "\"Wine12\"=dword:01020304 #comment\n"
- "\"Wine13\"=dword:02040608 ;comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine10");
- verify_reg(hkey, "Wine11", REG_SZ, "Value 2", 8, 0);
- verify_reg_nonexist(hkey, "Wine12");
- dword = 0x2040608;
- verify_reg(hkey, "Wine13", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine14\"=hex(7):4c,69,6e,65,20,\\\n"
- " #comment\n"
- " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n"
- "\"Wine15\"=\"A valid line\"\n"
- "\"Wine16\"=hex(7):4c,69,6e,65,20,\\\n"
- " ;comment\n"
- " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n"
- "\"Wine17\"=\"Another valid line\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine14");
- verify_reg(hkey, "Wine15", REG_SZ, "A valid line", 13, 0);
- verify_reg(hkey, "Wine16", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "Wine17", REG_SZ, "Another valid line", 19, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "#\"Comment1\"=\"Value 1\"\n"
- ";\"Comment2\"=\"Value 2\"\n"
- " #\"Comment3\"=\"Value 3\"\n"
- " ;\"Comment4\"=\"Value 4\"\n"
- "\"Wine18\"=\"Value 6\"#\"Comment5\"=\"Value 5\"\n"
- "\"Wine19\"=\"Value 7\";\"Comment6\"=\"Value 6\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Comment1");
- verify_reg_nonexist(hkey, "Comment2");
- verify_reg_nonexist(hkey, "Comment3");
- verify_reg_nonexist(hkey, "Comment4");
- verify_reg_nonexist(hkey, "Wine18");
- verify_reg_nonexist(hkey, "Comment5");
- verify_reg(hkey, "Wine19", REG_SZ, "Value 7", 8, 0);
- verify_reg_nonexist(hkey, "Comment6");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine20\"=#\"Value 8\"\n"
- "\"Wine21\"=;\"Value 9\"\n"
- "\"Wine22\"=\"#comment1\"\n"
- "\"Wine23\"=\";comment2\"\n"
- "\"Wine24\"=\"Value#comment3\"\n"
- "\"Wine25\"=\"Value;comment4\"\n"
- "\"Wine26\"=\"Value #comment5\"\n"
- "\"Wine27\"=\"Value ;comment6\"\n"
- "\"Wine28\"=#dword:00000001\n"
- "\"Wine29\"=;dword:00000002\n"
- "\"Wine30\"=dword:00000003#comment\n"
- "\"Wine31\"=dword:00000004;comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine20");
- verify_reg_nonexist(hkey, "Wine21");
- verify_reg(hkey, "Wine22", REG_SZ, "#comment1", 10, 0);
- verify_reg(hkey, "Wine23", REG_SZ, ";comment2", 10, 0);
- verify_reg(hkey, "Wine24", REG_SZ, "Value#comment3", 15, 0);
- verify_reg(hkey, "Wine25", REG_SZ, "Value;comment4", 15, 0);
- verify_reg(hkey, "Wine26", REG_SZ, "Value #comment5", 16, 0);
- verify_reg(hkey, "Wine27", REG_SZ, "Value ;comment6", 16, 0);
- verify_reg_nonexist(hkey, "Wine28");
- verify_reg_nonexist(hkey, "Wine29");
- verify_reg_nonexist(hkey, "Wine30");
- dword = 0x00000004;
- verify_reg(hkey, "Wine31", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line1\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,\\;comment\n"
- " 63,61,74,\\;comment\n"
- " 65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line1", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line2\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,\\;comment\n"
- " 63,61,74,;comment\n"
- " 65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line2", REG_MULTI_SZ, "Line concat", 12, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line3\"=hex(7):4c,69,6e,65,20\\\n"
- ",63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line3");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line4\"=hex(7):4c,69,6e,65,20\\\n"
- " ,63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line4");
- test_import_str("Windows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line5\"=hex(7):4c,69,6e,65,20\\\n"
- ",63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line5");
- test_import_str("Windows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line6\"=hex(7):4c,69,6e,65,20\\\n"
- " ,63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line6");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line7\"=hex(7):4c,69,6e,\\;comment\n"
- " 65,20,\\;comment\n"
- " 63,6f,6e,\\;comment\n"
- " 63,61,74,\\;comment\n"
- " 65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line7", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line8\"=hex(7):4c,69,6e,\\;#comment\n"
- " 65,20,\\;#comment\n"
- " 63,6f,6e,\\;#comment\n"
- " 63,61,74,\\;#comment\n"
- " 65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line8", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line9\"=hex(7):4c,69,6e,\\;comment\n"
- " 65,20,\\;comment\n"
- " 63,6f,6e,\\;comment\n"
- " 63,61,74,\\#comment\n"
- " 65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line9");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line10\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,\\;comment\n"
- " 63,61,74,\\\n\n"
- " 65,6e,\\;comment\n\n"
- " 61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line10", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine32a\"=dword:1\n"
- "\"Wine32b\"=dword:4444\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x1;
- verify_reg(hkey, "Wine32a", REG_DWORD, &dword, sizeof(dword), 0);
- dword = 0x4444;
- verify_reg(hkey, "Wine32b", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine33a\"=dword:\n"
- "\"Wine33b\"=dword:hello\n"
- "\"Wine33c\"=dword:123456789\n"
- "\"Wine33d\"=dword:012345678\n"
- "\"Wine33e\"=dword:000000001\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine33a");
- verify_reg_nonexist(hkey, "Wine33b");
- verify_reg_nonexist(hkey, "Wine33c");
- verify_reg_nonexist(hkey, "Wine33d");
- verify_reg_nonexist(hkey, "Wine33e");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine34a\"=dword:12345678abc\n"
- "\"Wine34b\"=dword:12345678 abc\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine34a");
- verify_reg_nonexist(hkey, "Wine34b");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine35a\"=dword:0x123\n"
- "\"Wine35b\"=dword:123 456\n"
- "\"Wine35c\"=dword:1234 5678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine35a");
- verify_reg_nonexist(hkey, "Wine35b");
- verify_reg_nonexist(hkey, "Wine35c");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine36a\"=dword:1234;5678\n"
- "\"Wine36b\"=dword:1234 ;5678\n"
- "\"Wine36c\"=dword:1234#5678\n"
- "\"Wine36d\"=dword:1234 #5678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x1234;
- verify_reg(hkey, "Wine36a", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine36b", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg_nonexist(hkey, "Wine36c");
- verify_reg_nonexist(hkey, "Wine36d");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine37a\"=\"foo\"bar\"\n"
- "\"Wine37b\"=\"foo\"\"bar\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine37a");
- verify_reg_nonexist(hkey, "Wine37b");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Empty string\"=\"\"\n"
- "\"\"=\"Default Value Name\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Empty string", REG_SZ, "", 1, 0);
- verify_reg(hkey, NULL, REG_SZ, "Default Value Name", 19, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test38a\"=\n"
- "\"Test38b\"=\\\"\n"
- "\"Test38c\"=\\\"Value\\\"\n"
- "\"Test38d\"=\\\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test38a");
- verify_reg_nonexist(hkey, "Test38b");
- verify_reg_nonexist(hkey, "Test38c");
- verify_reg_nonexist(hkey, "Test38d");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine39a\"=\"Value1\" ;comment\n"
- "\"Wine39b\"=\"Value2\"\t\t;comment\n"
- "\"Wine39c\"=\"Value3\" #comment\n"
- "\"Wine39d\"=\"Value4\"\t\t#comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine39a", REG_SZ, "Value1", 7, 0);
- verify_reg(hkey, "Wine39b", REG_SZ, "Value2", 7, 0);
- verify_reg_nonexist(hkey, "Wine39c");
- verify_reg_nonexist(hkey, "Wine39d");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"TestNoBeginQuote\"=Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "TestNoBeginQuote");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"TestNoEndQuote\"=\"Asdffdsa\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "TestNoEndQuote");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"TestNoQuotes\"=Asdffdsa\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "TestNoQuotes");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "NameNoBeginQuote\"=\"Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "NameNoBeginQuote");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"NameNoEndQuote=\"Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "NameNoEndQuote");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "NameNoQuotes=\"Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "NameNoQuotes");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"MixedQuotes=Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "MixedQuotes");
- verify_reg_nonexist(hkey, "MixedQuotes=Asdffdsa");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine40a\"=hex(2):4c,69,6e,65,00\n"
- "\"Wine40b\"=\"Value 1\"\n"
- "\"Wine40c\"=hex(2):4c,69,6e,65\\\n"
- "\"Wine40d\"=\"Value 2\"\n"
- "\"Wine40e\"=hex(2):4c,69,6e,65,\\\n"
- "\"Wine40f\"=\"Value 3\"\n"
- "\"Wine40g\"=\"Value 4\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine40a", REG_EXPAND_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine40b", REG_SZ, "Value 1", 8, 0);
- verify_reg_nonexist(hkey, "Wine40c");
- verify_reg(hkey, "Wine40d", REG_SZ, "Value 2", 8, 0);
- verify_reg_nonexist(hkey, "Wine40e");
- verify_reg_nonexist(hkey, "Wine40f");
- verify_reg(hkey, "Wine40g", REG_SZ, "Value 4", 8, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine41a\"=dword:1234\\\n"
- "5678\n"
- "\"Wine41b\"=\"Test \\\n"
- "Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine41a");
- verify_reg_nonexist(hkey, "Wine41b");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"double\\\"quote\"=\"valid \\\"or\\\" not\"\n"
- "\"single'quote\"=dword:00000008\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "double\"quote", REG_SZ, "valid \"or\" not", 15, 0);
- dword = 0x00000008;
- verify_reg(hkey, "single'quote", REG_DWORD, &dword, sizeof(dword), 0);
- /* Test key name and value name concatenation */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\\n"
- "Subkey1]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey1");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\n"
- "\\Subkey2]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey2");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine\\\n"
- "42a\"=\"Value 1\"\n"
- "\"Wine42b\"=\"Value 2\"\n"
- "\"Wine\n"
- "\\42c\"=\"Value 3\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine42a");
- verify_reg(hkey, "Wine42b", REG_SZ, "Value 2", 8, 0);
- verify_reg_nonexist(hkey, "Wine42c");
- /* Test hex data concatenation for REG_NONE, REG_EXPAND_SZ and REG_BINARY */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine43a\"=hex(0):56,00,61,00,6c,00,75,00,65,00,00,00\n"
- "\"Wine43b\"=hex(0):56,00,61,00,6c,00,\\\n"
- " 75,00,65,00,00,00\n"
- "\"Wine43c\"=hex(0):56,00,61,00,6c,00\\\n"
- ",75,00,65,00,00,00\n"
- "\"Wine43d\"=hex(0):56,00,61,00,6c,00\\\n"
- " ,75,00,65,00,00,00\n"
- "\"Wine43e\"=hex(0):56,00,61,00,6c,00\\\n"
- " 75,00,65,00,00,00\n"
- "\"Wine43f\"=hex(0):56,00,61,00,6c,00,7\\\n"
- "5,00,65,00,00,00\n"
- "\"Wine43g\"=hex(0):56,00,61,00,6c,00,7\\\n"
- " 5,00,65,00,00,00\n"
- "\"Wine43h\"=hex(0):56,00,61,00,\\;comment\n"
- " 6c,00,75,00,\\\n"
- " 65,00,00,00\n"
- "\"Wine43i\"=hex(0):56,00,61,00,\\;comment\n"
- " 6c,00,75,00,\n"
- " 65,00,00,00\n"
- "\"Wine43j\"=hex(0):56,00,61,00,\\;comment\n"
- " 6c,00,75,00,;comment\n"
- " 65,00,00,00\n"
- "\"Wine43k\"=hex(0):56,00,61,00,\\;comment\n"
- " 6c,00,75,00,\\#comment\n"
- " 65,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine43a", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- verify_reg(hkey, "Wine43b", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- verify_reg_nonexist(hkey, "Wine43c");
- verify_reg_nonexist(hkey, "Wine43d");
- verify_reg_nonexist(hkey, "Wine43e");
- verify_reg_nonexist(hkey, "Wine43f");
- verify_reg_nonexist(hkey, "Wine43g");
- verify_reg(hkey, "Wine43h", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- verify_reg(hkey, "Wine43i", REG_NONE, "V\0a\0l\0u", 8, 0);
- verify_reg(hkey, "Wine43j", REG_NONE, "V\0a\0l\0u", 8, 0);
- verify_reg_nonexist(hkey, "Wine43k");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine44a\"=hex(2):25,50,41,54,48,25,00\n"
- "\"Wine44b\"=hex(2):25,50,41,\\\n"
- " 54,48,25,00\n"
- "\"Wine44c\"=hex(2):25,50,41\\\n"
- ",54,48,25,00\n"
- "\"Wine44d\"=hex(2):25,50,41\\\n"
- " ,54,48,25,00\n"
- "\"Wine44e\"=hex(2):25,50,41\\\n"
- " 54,48,25,00\n"
- "\"Wine44f\"=hex(2):25,50,4\\\n"
- "1,54,48,25,00\n"
- "\"Wine44g\"=hex(2):25,50,4\\\n"
- " 1,54,48,25,00\n"
- "\"Wine44h\"=hex(2):25,50,41,\\;comment\n"
- " 54,48,\\\n"
- " 25,00\n"
- "\"Wine44i\"=hex(2):25,50,41,\\;comment\n"
- " 54,48,\n"
- " 25,00\n"
- "\"Wine44j\"=hex(2):25,50,41,\\;comment\n"
- " 54,48,;comment\n"
- " 25,00\n"
- "\"Wine44k\"=hex(2):25,50,41,\\;comment\n"
- " 54,48,\\#comment\n"
- " 25,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine44a", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine44b", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg_nonexist(hkey, "Wine44c");
- verify_reg_nonexist(hkey, "Wine44d");
- verify_reg_nonexist(hkey, "Wine44e");
- verify_reg_nonexist(hkey, "Wine44f");
- verify_reg_nonexist(hkey, "Wine44g");
- verify_reg(hkey, "Wine44h", REG_EXPAND_SZ, "%PATH%", 7, 0);
- /* Wine44i */
- size = sizeof(buffer);
- err = RegQueryValueExA(hkey, "Wine44i", NULL, &type, (BYTE *)&buffer, &size);
- ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
- ok(type == REG_EXPAND_SZ, "got wrong type %u, expected %u\n", type, REG_EXPAND_SZ);
- ok(size == 6 || broken(size == 5) /* WinXP */, "got wrong size %u, expected 6\n", size);
- ok(memcmp(buffer, "%PATH", size) == 0, "got wrong data\n");
- /* Wine44j */
- size = sizeof(buffer);
- memset(buffer, '-', size);
- err = RegQueryValueExA(hkey, "Wine44j", NULL, &type, (BYTE *)&buffer, &size);
- ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
- ok(type == REG_EXPAND_SZ, "got wrong type %u, expected %u\n", type, REG_EXPAND_SZ);
- ok(size == 6 || broken(size == 5) /* WinXP */, "got wrong size %u, expected 6\n", size);
- ok(memcmp(buffer, "%PATH", size) == 0, "got wrong data\n");
- /* Wine44k */
- verify_reg_nonexist(hkey, "Wine44k");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine45a\"=hex:11,22,33,44,55,66,77,88\n"
- "\"Wine45b\"=hex:11,22,33,44,\\\n"
- " 55,66,77,88\n"
- "\"Wine45c\"=hex:11,22,33,44\\\n"
- ",55,66,77,88\n"
- "\"Wine45d\"=hex:11,22,33,44\\\n"
- " ,55,66,77,88\n"
- "\"Wine45e\"=hex:11,22,33,44\\\n"
- " 55,66,77,88\n"
- "\"Wine45f\"=hex:11,22,33,4\\\n"
- "4,55,66,77,88\n"
- "\"Wine45g\"=hex:11,22,33,4\\\n"
- " 4,55,66,77,88\n"
- "\"Wine45h\"=hex:11,22,33,44,\\;comment\n"
- " 55,66,\\\n"
- " 77,88\n"
- "\"Wine45i\"=hex:11,22,33,44,\\;comment\n"
- " 55,66,\n"
- " 77,88\n"
- "\"Wine45j\"=hex:11,22,33,44,\\;comment\n"
- " 55,66,;comment\n"
- " 77,88\n"
- "\"Wine45k\"=hex:11,22,33,\\;comment\n"
- " 44,55,66,\\#comment\n"
- " 77,88\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- hex[0] = 0x11; hex[1] = 0x22; hex[2] = 0x33; hex[3] = 0x44;
- hex[4] = 0x55; hex[5] = 0x66; hex[6] = 0x77; hex[7] = 0x88;
- verify_reg(hkey, "Wine45a", REG_BINARY, hex, sizeof(hex), 0);
- verify_reg(hkey, "Wine45b", REG_BINARY, hex, sizeof(hex), 0);
- verify_reg_nonexist(hkey, "Wine45c");
- verify_reg_nonexist(hkey, "Wine45d");
- verify_reg_nonexist(hkey, "Wine45e");
- verify_reg_nonexist(hkey, "Wine45f");
- verify_reg_nonexist(hkey, "Wine45g");
- verify_reg(hkey, "Wine45h", REG_BINARY, hex, sizeof(hex), 0);
- verify_reg(hkey, "Wine45i", REG_BINARY, hex, 6, 0);
- verify_reg(hkey, "Wine45j", REG_BINARY, hex, 6, 0);
- verify_reg_nonexist(hkey, "Wine45k");
- /* Test import with subkeys */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey\"1]\n"
- "\"Wine\\\\31\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- open_key(hkey, "Subkey\"1", 0, &subkey);
- verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0);
- close_key(subkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n"
- "\"123/\\\"4;'5\"=\"Random value name\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- open_key(hkey, "Subkey/2", 0, &subkey);
- verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0);
- close_key(subkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2");
- /* Test key creation */
- test_import_str("REGEDIT4\n\n"
- "HKEY_CURRENT_USER\\" KEY_BASE "\\No_Opening_Bracket]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "No_Opening_Bracket");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\No_Closing_Bracket\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "No_Closing_Bracket");
- test_import_str("REGEDIT4\n\n"
- "[ HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1a]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey1a");
- test_import_str("REGEDIT4\n\n"
- "[\tHKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1b]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey1b");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1c ");
- delete_key(hkey, "Subkey1c ");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1d\t");
- delete_key(hkey, "Subkey1d\t");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n"
- "\"Wine\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1e\\");
- verify_key(hkey, "Subkey1e");
- open_key(hkey, "Subkey1e", 0, &subkey);
- verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
- close_key(subkey);
- delete_key(hkey, "Subkey1e");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n"
- "\"Wine\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1f\\\\");
- verify_key(hkey, "Subkey1f\\");
- verify_key(hkey, "Subkey1f");
- open_key(hkey, "Subkey1f\\\\", 0, &subkey);
- verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
- close_key(subkey);
- delete_key(hkey, "Subkey1f\\\\");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n"
- "\"Wine\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1g\\\\\\\\");
- verify_key(hkey, "Subkey1g\\\\");
- verify_key(hkey, "Subkey1g\\");
- verify_key(hkey, "Subkey1g");
- open_key(hkey, "Subkey1g\\\\", 0, &subkey);
- verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
- close_key(subkey);
- delete_key(hkey, "Subkey1g\\\\");
- /* Test key deletion. We start by creating some registry keys. */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2a");
- verify_key(hkey, "Subkey2b");
- test_import_str("REGEDIT4\n\n"
- "[ -HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2a");
- test_import_str("REGEDIT4\n\n"
- "[\t-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2b");
- test_import_str("REGEDIT4\n\n"
- "[- HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2a");
- test_import_str("REGEDIT4\n\n"
- "[-\tHKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2b");
- test_import_str("REGEDIT4\n\n"
- "[-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n\n"
- "[-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey2a");
- verify_key_nonexist(hkey, "Subkey2b");
- /* Test case sensitivity when creating and deleting registry keys. */
- test_import_str("REGEDIT4\n\n"
- "[hkey_CURRENT_user\\" KEY_BASE "\\Subkey3a]\n\n"
- "[HkEy_CuRrEnT_uSeR\\" KEY_BASE "\\SuBkEy3b]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey3a");
- verify_key(hkey, "Subkey3b");
- test_import_str("REGEDIT4\n\n"
- "[-HKEY_current_USER\\" KEY_BASE "\\sUBKEY3A]\n\n"
- "[-hKeY_cUrReNt_UsEr\\" KEY_BASE "\\sUbKeY3B]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey3a");
- verify_key_nonexist(hkey, "Subkey3b");
- /* Test mixed key creation and deletion. We start by creating a subkey. */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey4a]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey4a");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"
- "[-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey4a]\n"
- "\"Wine46a\"=dword:12345678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey4a");
- verify_reg_nonexist(hkey, "Wine46a");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"
- "[HKEY_CURRENT_USERS\\" KEY_BASE "\\Subkey4b]\n"
- "\"Wine46b\"=dword:12345678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey4b");
- verify_reg_nonexist(hkey, "Wine46b");
- /* Test value deletion. We start by creating some registry values. */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine46a\"=\"Test Value\"\n"
- "\"Wine46b\"=dword:00000008\n"
- "\"Wine46c\"=hex:11,22,33,44\n"
- "\"Wine46d\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n"
- "\"Wine46e\"=hex(2):25,50,41,54,48,25,00\n"
- "\"Wine46f\"=hex(0):56,00,61,00,6c,00,75,00,65,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine46a", REG_SZ, "Test Value", 11, 0);
- verify_reg(hkey, "Wine46b", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine46c", REG_BINARY, hex, 4, 0);
- verify_reg(hkey, "Wine46d", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "Wine46e", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine46f", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine46a\"=-\n"
- "\"Wine46b\"= -\n"
- "\"Wine46c\"= \t-\t \n"
- "\"Wine46d\"=-\"Test\"\n"
- "\"Wine46e\"=- ;comment\n"
- "\"Wine46f\"=- #comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine46a");
- verify_reg_nonexist(hkey, "Wine46b");
- verify_reg_nonexist(hkey, "Wine46c");
- verify_reg(hkey, "Wine46d", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg_nonexist(hkey, "Wine46e");
- verify_reg(hkey, "Wine46f", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- /* Test the accepted range of the hex-based data types */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine47a\"=hex(0):56,61,6c,75,65,00\n"
- "\"Wine47b\"=hex(10):56,61,6c,75,65,00\n"
- "\"Wine47c\"=hex(100):56,61,6c,75,65,00\n"
- "\"Wine47d\"=hex(1000):56,61,6c,75,65,00\n"
- "\"Wine47e\"=hex(7fff):56,61,6c,75,65,00\n"
- "\"Wine47f\"=hex(ffff):56,61,6c,75,65,00\n"
- "\"Wine47g\"=hex(7fffffff):56,61,6c,75,65,00\n"
- "\"Wine47h\"=hex(ffffffff):56,61,6c,75,65,00\n"
- "\"Wine47i\"=hex(100000000):56,61,6c,75,65,00\n"
- "\"Wine47j\"=hex(0x2):56,61,6c,75,65,00\n"
- "\"Wine47k\"=hex(0X2):56,61,6c,75,65,00\n"
- "\"Wine47l\"=hex(x2):56,61,6c,75,65,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine47a", REG_NONE, "Value", 6, 0);
- verify_reg(hkey, "Wine47b", 0x10, "Value", 6, 0);
- verify_reg(hkey, "Wine47c", 0x100, "Value", 6, 0);
- verify_reg(hkey, "Wine47d", 0x1000, "Value", 6, 0);
- verify_reg(hkey, "Wine47e", 0x7fff, "Value", 6, 0);
- verify_reg(hkey, "Wine47f", 0xffff, "Value", 6, 0);
- verify_reg(hkey, "Wine47g", 0x7fffffff, "Value", 6, 0);
- verify_reg(hkey, "Wine47h", 0xffffffff, "Value", 6, 0);
- verify_reg_nonexist(hkey, "Wine47i");
- verify_reg_nonexist(hkey, "Wine47j");
- verify_reg_nonexist(hkey, "Wine47k");
- verify_reg_nonexist(hkey, "Wine47l");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine48a\"=hex(7):4c,69,6e,65,20, \\\n"
- " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n"
- "\"Wine48b\"=hex(7):4c,69,6e,65,20,\t\\\n"
- " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine48a", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "Wine48b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine49\"=hex(2):25,50,41,54,48,25,00,\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine49", REG_EXPAND_SZ, "%PATH%", 7, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine50a\"=hex(2):25,50,41,54,48,25,00 ;comment\n"
- "\"Wine50b\"=hex(2):25,50,41,54,48,25,00\t;comment\n"
- "\"Wine50c\"=hex(2):25,50,41,54,48,25,00 #comment\n"
- "\"Wine50d\"=hex(2):25,50,41,54,48,25,00\t#comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine50a", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine50b", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg_nonexist(hkey, "Wine50c");
- verify_reg_nonexist(hkey, "Wine50d");
- /* Test support for characters greater than 0xff */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine51a\"=hex(0):25,50,100,54,48,25,00\n"
- "\"Wine51b\"=hex(0):25,1a4,100,164,124,25,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine51a");
- verify_reg_nonexist(hkey, "Wine51b");
- /* Test the effect of backslashes in hex data */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine52a\"=hex(2):25,48\\,4f,4d,45,25,00\n"
- "\"Wine52b\"=hex(2):25,48,\\4f,4d,45,25,00\n"
- "\"Wine52c\"=hex(2):25,48\\ ,4f,4d,45,25,00\n"
- "\"Wine52d\"=hex(2):25,48,\\ 4f,4d,45,25,00\n"
- "\"Wine52e\"=hex(2):\\25,48,4f,4d,45,25,00\n"
- "\"Wine52f\"=hex(2):\\ 25,48,4f,4d,45,25,00\n"
- "\"Wine52g\"=hex(2):25,48,4\\f,4d,45,25,00\n"
- "\"Wine52h\"=hex(2):25,48,4\\\n"
- " f,4d,45,25,00\n"
- "\"Wine52i\"=hex(2):25,50,\\,41,54,48,25,00\n"
- "\"Wine52j\"=hex(2):25,48,4f,4d,45,25,5c,\\\\\n"
- " 25,50,41,54,48,25,00\n"
- "\"Wine52k\"=hex(2):,\\\n"
- " 25,48,4f,4d,45,25,00\n"
- "\"Wine52l\"=hex(2):\\\n"
- " 25,48,4f,4d,45,25,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine52a");
- verify_reg_nonexist(hkey, "Wine52b");
- verify_reg_nonexist(hkey, "Wine52c");
- verify_reg_nonexist(hkey, "Wine52d");
- verify_reg_nonexist(hkey, "Wine52e");
- verify_reg_nonexist(hkey, "Wine52f");
- verify_reg_nonexist(hkey, "Wine52g");
- verify_reg_nonexist(hkey, "Wine52h");
- verify_reg_nonexist(hkey, "Wine52i");
- verify_reg_nonexist(hkey, "Wine52j");
- verify_reg_nonexist(hkey, "Wine52k");
- verify_reg(hkey, "Wine52l", REG_EXPAND_SZ, "%HOME%", 7, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine53a\"=hex(2):25,48,4f,4d,45,25,5c,\\\n"
- " 25,50,41,54,48,25,00\n"
- "\"Wine53b\"=hex(2):25,48,4f,4d,45,25,5c\\\n"
- " 25,50,41,54,48,25,00\n"
- "\"Wine53c\"=hex(2):25,48,4f,4d,45,25,5c, \\ ;comment\n"
- " 25,50,41,54,48,25,00\n"
- "\"Wine53d\"=hex(2):25,48,4f,4d,45,25,5c \\ ;comment\n"
- " 25,50,41,54,48,25,00\n"
- "\"Wine53e\"=hex(2):25,48,4f,4d,45,25,5c,\\\t ;comment\n"
- " 25,50,41,54,48,25,00\n"
- "\"Wine53f\"=hex(2):25,48,4f,4d,45,25,5c\\\t ;comment\n"
- " 25,50,41,54,48,25,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine53a", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14, 0);
- verify_reg_nonexist(hkey, "Wine53b");
- verify_reg(hkey, "Wine53c", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14, 0);
- verify_reg_nonexist(hkey, "Wine53d");
- verify_reg(hkey, "Wine53e", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14, 0);
- verify_reg_nonexist(hkey, "Wine53f");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine54a\"=hex(2):4c,69,6e,65,20,\\\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine54a");
- verify_key_nonexist(hkey, "Subkey1");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine54b\"=hex(2):4c,69,6e,65,20\\\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine54b");
- verify_key(hkey, "Subkey2");
- delete_key(hkey, "Subkey2");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine55a\"=hex(2):4c,69,6e,65,20,\\\n"
- "\"Wine55b\"=\"Test value\"\n"
- "\"Wine55c\"=hex(2):4c,69,6e,65,20,\\\n"
- ";comment\n"
- "\"Wine55d\"=\"Test value\"\n"
- "\"Wine55e\"=hex(2):4c,69,6e,65,20,\\\n"
- "#comment\n"
- "\"Wine55f\"=\"Test value\"\n"
- "\"Wine55g\"=hex(2):4c,69,6e,65,20,\\\n\n"
- "\"Wine55h\"=\"Test value\"\n"
- "\"Wine55i\"=hex(2):4c,69,6e,65,20\\\n"
- "\"Wine55j\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine55a");
- verify_reg_nonexist(hkey, "Wine55b");
- verify_reg_nonexist(hkey, "Wine55c");
- verify_reg_nonexist(hkey, "Wine55d");
- verify_reg_nonexist(hkey, "Wine55e");
- verify_reg(hkey, "Wine55f", REG_SZ, "Test value", 11, 0);
- verify_reg_nonexist(hkey, "Wine55g");
- verify_reg_nonexist(hkey, "Wine55h");
- verify_reg_nonexist(hkey, "Wine55i");
- verify_reg(hkey, "Wine55j", REG_SZ, "Test value", 11, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine56a\"=hex(2):4c,69,6e,65,20,\\\n"
- "\"Wine56b\"=dword:00000008\n"
- "\"Wine56c\"=hex(2):4c,69,6e,65,20,\\\n"
- ";comment\n"
- "\"Wine56d\"=dword:00000008\n"
- "\"Wine56e\"=hex(2):4c,69,6e,65,20,\\\n"
- "#comment\n"
- "\"Wine56f\"=dword:00000008\n"
- "\"Wine56g\"=hex(2):4c,69,6e,65,20,\\\n\n"
- "\"Wine56h\"=dword:00000008\n"
- "\"Wine56i\"=hex(2):4c,69,6e,65,20\\\n"
- "\"Wine56j\"=dword:00000008\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine56a");
- verify_reg_nonexist(hkey, "Wine56b");
- verify_reg_nonexist(hkey, "Wine56c");
- verify_reg_nonexist(hkey, "Wine56d");
- verify_reg_nonexist(hkey, "Wine56e");
- verify_reg(hkey, "Wine56f", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg_nonexist(hkey, "Wine56g");
- verify_reg_nonexist(hkey, "Wine56h");
- verify_reg_nonexist(hkey, "Wine56i");
- verify_reg(hkey, "Wine56j", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine57a\"=hex(2):25,48,4f,4d,45,25,5c,\\\n"
- "\"Wine57b\"=hex(2):25,50,41,54,48,25,00\n"
- "\"Wine57c\"=hex(2):25,48,4f,4d,45,25,5c,\\\n"
- ";comment\n"
- "\"Wine57d\"=hex(2):25,50,41,54,48,25,00\n"
- "\"Wine57e\"=hex(2):25,48,4f,4d,45,25,5c,\\\n"
- "#comment\n"
- "\"Wine57f\"=hex(2):25,50,41,54,48,25,00\n"
- "\"Wine57g\"=hex(2):25,48,4f,4d,45,25,5c,\\\n\n"
- "\"Wine57h\"=hex(2):25,50,41,54,48,25,00\n"
- "\"Wine57i\"=hex(2):25,48,4f,4d,45,25,5c\\\n"
- "\"Wine57j\"=hex(2):25,50,41,54,48,25,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine57a");
- verify_reg_nonexist(hkey, "Wine57b");
- verify_reg_nonexist(hkey, "Wine57c");
- verify_reg_nonexist(hkey, "Wine57d");
- verify_reg_nonexist(hkey, "Wine57e");
- verify_reg(hkey, "Wine57f", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg_nonexist(hkey, "Wine57g");
- verify_reg_nonexist(hkey, "Wine57h");
- verify_reg_nonexist(hkey, "Wine57i");
- verify_reg(hkey, "Wine57j", REG_EXPAND_SZ, "%PATH%", 7, 0);
- delete_value(hkey, NULL);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58a\"=hex(2):4c,69,6e,65,20,\\\n"
- "@=\"Default value 1\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58a");
- verify_reg_nonexist(hkey, NULL);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58b\"=hex(2):4c,69,6e,65,20,\\\n"
- ";comment\n"
- "@=\"Default value 2\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58b");
- verify_reg_nonexist(hkey, NULL);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58c\"=hex(2):4c,69,6e,65,20,\\\n"
- "#comment\n"
- "@=\"Default value 3\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58c");
- verify_reg(hkey, NULL, REG_SZ, "Default value 3", 16, 0);
- delete_value(hkey, NULL);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58d\"=hex(2):4c,69,6e,65,20,\\\n\n"
- "@=\"Default value 4\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58d");
- verify_reg_nonexist(hkey, NULL);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58e\"=hex(2):4c,69,6e,65,20\\\n"
- "@=\"Default value 5\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58e");
- verify_reg(hkey, NULL, REG_SZ, "Default value 5", 16, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine59a\"=hex:11,22,33,\\\n"
- "\\\n"
- " 44,55,66\n"
- "\"Wine59b\"=hex:11,22,33,\\\n"
- " \\\n"
- " 44,55,66\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine59a");
- verify_reg_nonexist(hkey, "Wine59b");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60a\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,63,61,74,\\\n"
- ";comment\n"
- " 65,6e,\\;comment\n"
- " 61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine60a", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60b\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,63,61,74,\\\n"
- " ;comment\n"
- " 65,6e,\\;comment\n"
- " 61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine60b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60c\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,63,61,74,\\\n"
- "#comment\n"
- " 65,6e,\\;comment\n"
- " 61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine60c");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60d\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,63,61,74,\\\n"
- " #comment\n"
- " 65,6e,\\;comment\n"
- " 61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine60d");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60e\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,\\\n\n"
- " 63,61,74,\\\n\n\n"
- " 65,6e,\\\n\n\n\n"
- " 61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine60e", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60f\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,\\\n \n"
- " 63,61,74,\\\n\t\n\t\n"
- " 65,6e,\\\n\t \t\n\t \t\n\t \t\n"
- " 61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine60f", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine61a\"=hex(0):25,48,4f,4d,45,25,5c,/\n"
- " 25,50,41,54,48,25,00\n"
- "\"Wine61b\"=hex(0):25,48,4f,4d,45,25,5c/\n"
- " 25,50,41,54,48,25,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine61a");
- verify_reg_nonexist(hkey, "Wine61b");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62a\"=hex(0):56,61,6c,75,65,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62a", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62a", REG_NONE, "Value", 5, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62b\"=hex(2):25,50,41,54,48,25,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62b", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62b", REG_EXPAND_SZ, "%PATH%", 7, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62c\"=hex:11,22,33,44,55,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62c", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62c", REG_BINARY, hex, 5, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62d\"=hex(7):4c,69,6e,65,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62d", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62d", REG_MULTI_SZ, "Line", 5, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62e\"=hex(100):56,61,6c,75,65,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62e", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62e", 0x100, "Value", 5, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62f\"=hex(7):4c,69,6e,65,20\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine62f");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine63a\"=hex(7):4c,69,6e,65,20,\\\n"
- " ,63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n"
- "\"Wine63b\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine63a");
- verify_reg_nonexist(hkey, "Wine63b");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine64a\"=hex(7):4c,69,6e,65,00,00\n"
- "\"Wine64b\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n"
- "\"Wine64c\"=hex(7):4c,69,6e,65,20,\\;comment\n"
- " 63,6f,6e,63,61,74,\\\n"
- " 65,6e,61,74,69,6f,6e,00,00\n"
- "\"Wine64d\"=hex(7):4c,69,6e,65,20,\\;comment\n"
- " 63,6f,6e,63,61,74,\n"
- " 65,6e,61,74,69,6f,6e,00,00\n"
- "\"Wine64e\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,63,61,74,;comment\n"
- " 65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine64a", REG_MULTI_SZ, "Line\0", 6, 0);
- verify_reg(hkey, "Wine64b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "Wine64c", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- /* Wine64d */
- size = sizeof(buffer);
- err = RegQueryValueExA(hkey, "Wine64d", NULL, &type, (BYTE *)&buffer, &size);
- ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
- ok(type == REG_MULTI_SZ, "got wrong type %u, expected %u\n", type, REG_MULTI_SZ);
- ok(size == 12 || broken(size == 11) /* WinXP */, "got wrong size %u, expected 12\n", size);
- ok(memcmp(buffer, "Line concat", size) == 0, "got wrong data\n");
- /* Wine64e */
- size = sizeof(buffer);
- err = RegQueryValueExA(hkey, "Wine64e", NULL, &type, (BYTE *)&buffer, &size);
- ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
- ok(type == REG_MULTI_SZ, "got wrong type %u, expected %u\n", type, REG_MULTI_SZ);
- ok(size == 12 || broken(size == 11) /* WinXP */, "got wrong size %u, expected 12\n", size);
- ok(memcmp(buffer, "Line concat", size) == 0, "got wrong data\n");
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine65a\"=hex(100):25,50,41,54,48,25,00\n"
- "\"Wine65b\"=hex(100):25,50,41,\\\n"
- " 54,48,25,00\n"
- "\"Wine65c\"=hex(100):25,50,41,\\;comment\n"
- " 54,48,\\\n"
- " 25,00\n"
- "\"Wine65d\"=hex(100):25,50,41,\\;comment\n"
- " 54,48,\n"
- " 25,00\n"
- "\"Wine65e\"=hex(100):25,50,41,\\;comment\n"
- " 54,48,;comment\n"
- " 25,00\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine65a", 0x100, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine65b", 0x100, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine65c", 0x100, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine65d", 0x100, "%PATH", 5, 0);
- verify_reg(hkey, "Wine65e", 0x100, "%PATH", 5, 0);
- /* Test null-termination of REG_EXPAND_SZ and REG_MULTI_SZ data*/
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine66a\"=hex(7):4c,69,6e,65\n"
- "\"Wine66b\"=hex(7):4c,69,6e,65,\n"
- "\"Wine66c\"=hex(7):4c,69,6e,65,00\n"
- "\"Wine66d\"=hex(7):4c,69,6e,65,00,\n"
- "\"Wine66e\"=hex(7):4c,69,6e,65,00,00\n"
- "\"Wine66f\"=hex(7):4c,69,6e,65,00,00,\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine66a", REG_MULTI_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine66b", REG_MULTI_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine66c", REG_MULTI_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine66d", REG_MULTI_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine66e", REG_MULTI_SZ, "Line\0", 6, 0);
- verify_reg(hkey, "Wine66f", REG_MULTI_SZ, "Line\0", 6, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine67a\"=hex(2):25,50,41,54,48,25\n"
- "\"Wine67b\"=hex(2):25,50,41,54,48,25,\n"
- "\"Wine67c\"=hex(2):25,50,41,54,48,25,00\n"
- "\"Wine67d\"=hex(2):25,50,41,54,48,25,00,\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine67a", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine67b", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine67c", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine67d", REG_EXPAND_SZ, "%PATH%", 7, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine68a\"=hex(1):\n"
- "\"Wine68b\"=hex(2):\n"
- "\"Wine68c\"=hex(3):\n"
- "\"Wine68d\"=hex(4):\n"
- "\"Wine68e\"=hex(7):\n"
- "\"Wine68f\"=hex(100):\n"
- "\"Wine68g\"=hex(abcd):\n"
- "\"Wine68h\"=hex:\n"
- "\"Wine68i\"=hex(0):\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine68a", REG_SZ, NULL, 0, 0);
- verify_reg(hkey, "Wine68b", REG_EXPAND_SZ, NULL, 0, 0);
- verify_reg(hkey, "Wine68c", REG_BINARY, NULL, 0, 0);
- verify_reg(hkey, "Wine68d", REG_DWORD, NULL, 0, 0);
- verify_reg(hkey, "Wine68e", REG_MULTI_SZ, NULL, 0, 0);
- verify_reg(hkey, "Wine68f", 0x100, NULL, 0, 0);
- verify_reg(hkey, "Wine68g", 0xabcd, NULL, 0, 0);
- verify_reg(hkey, "Wine68h", REG_BINARY, NULL, 0, 0);
- verify_reg(hkey, "Wine68i", REG_NONE, NULL, 0, 0);
- /* Test with escaped null characters */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine69a\"=\"\\\\0\"\n"
- "\"Wine69b\"=\"\\\\0\\\\0\"\n"
- "\"Wine69c\"=\"Value1\\\\0\"\n"
- "\"Wine69d\"=\"Value2\\\\0\\\\0\\\\0\\\\0\"\n"
- "\"Wine69e\"=\"Value3\\\\0Value4\"\n"
- "\"Wine69f\"=\"\\\\0Value5\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine69a", REG_SZ, "\\0", 3, 0);
- verify_reg(hkey, "Wine69b", REG_SZ, "\\0\\0", 5, 0);
- verify_reg(hkey, "Wine69c", REG_SZ, "Value1\\0", 9, 0);
- verify_reg(hkey, "Wine69d", REG_SZ, "Value2\\0\\0\\0\\0", 15, 0);
- verify_reg(hkey, "Wine69e", REG_SZ, "Value3\\0Value4", 15, 0);
- verify_reg(hkey, "Wine69f", REG_SZ, "\\0Value5", 9, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine70a\"=\"\\0\"\n"
- "\"Wine70b\"=\"\\0\\0\"\n"
- "\"Wine70c\"=\"Value1\\0\"\n"
- "\"Wine70d\"=\"Value2\\0\\0\\0\\0\"\n"
- "\"Wine70e\"=\"Value3\\0Value4\"\n"
- "\"Wine70f\"=\"\\0Value5\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine70a");
- verify_reg_nonexist(hkey, "Wine70b");
- verify_reg_nonexist(hkey, "Wine70c");
- verify_reg_nonexist(hkey, "Wine70d");
- verify_reg_nonexist(hkey, "Wine70e");
- verify_reg_nonexist(hkey, "Wine70f");
- /* Test forward and back slashes */
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"count/up\"=\"one/two/three\"\n"
- "\"\\\\foo\\\\bar\"=\"\"\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\https://winehq.org]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "count/up", REG_SZ, "one/two/three", 14, 0);
- verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0);
- verify_key(hkey, "https://winehq.org");
- close_key(hkey);
- delete_tree(HKEY_CURRENT_USER, KEY_BASE);
- }
- static void test_unicode_import(void)
- {
- DWORD r, dword = 0x123, type, size;
- HKEY hkey, subkey;
- LONG err;
- char buffer[24];
- BYTE hex[8];
- delete_tree(HKEY_CURRENT_USER, KEY_BASE);
- verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
- test_import_wstr("REGEDIT\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_wstr("REGEDIT4\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_wstr("\xef\xbb\xbfREGEDIT", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbfREGEDIT\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbfREGEDIT4", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbfREGEDIT4\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbf REGEDIT4\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbf\tREGEDIT4\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbf\nREGEDIT4\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_wstr("\xef\xbb\xbfREGEDIT4\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- open_key(HKEY_CURRENT_USER, KEY_BASE, KEY_SET_VALUE, &hkey);
- test_import_wstr("\xef\xbb\xbfREGEDIT3\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test1\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test1");
- test_import_wstr("\xef\xbb\xbfregedit4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test2\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test2");
- test_import_wstr("\xef\xbb\xbfRegedit4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test3\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test3");
- test_import_wstr("\xef\xbb\xbfREGEDIT 4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test4\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test4");
- test_import_wstr("\xef\xbb\xbfREGEDIT4FOO\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test5\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test5");
- test_import_wstr("\xef\xbb\xbfREGEDIT4 FOO\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test6\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test6");
- test_import_wstr("\xef\xbb\xbfREGEDIT5\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test7\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test7");
- test_import_wstr("\xef\xbb\xbfREGEDIT9\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test8\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test8");
- test_import_wstr("\xef\xbb\xbfREGEDIT4\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Unicode1\"=\"Value1\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Unicode1", REG_SZ, "Value1", 7, 0);
- test_import_wstr("\xef\xbb\xbfREGEDIT4\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Unicode2\"=\"Value2\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Unicode2", REG_SZ, "Value2", 7, 0);
- test_import_wstr("\xef\xbb\xbfREGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Unicode3\"=\"Value3\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Unicode3", REG_SZ, "Value3", 7, 0);
- test_import_wstr("Windows Registry Editor Version 4.00\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_wstr("Windows Registry Editor Version 5.00\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbfWINDOWS Registry Editor Version 5.00\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbf\tWindows Registry Editor Version 5.00\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- test_import_wstr("\xef\xbb\xbf\nWindows Registry Editor Version 5.00\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 4.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test9\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test9");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test10\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test10");
- test_import_wstr("\xef\xbb\xbfWINDOWS REGISTRY EDITOR VERSION 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test11\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test11");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test12\"=\"Value\"\n", &r);
- ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS) /* WinXP */,
- "got exit code %d, expected 1\n", r);
- verify_reg_nonexist(hkey, "Test12");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine\"=dword:00000123\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "@=\"Test string\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, NULL, REG_SZ, "Test string", 12, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Unicode4\"=\"Value4\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Unicode4", REG_SZ, "Value4", 7, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Unicode5\"=\"Value5\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Unicode5", REG_SZ, "Value5", 7, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Unicode6\"=\"Value6\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Unicode6", REG_SZ, "Value6", 7, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Line1\"=\"Value1\"\n\n"
- "\"Line2\"=\"Value2\"\n\n\n"
- "\"Line3\"=\"Value3\"\n\n\n\n"
- "\"Line4\"=\"Value4\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Line1", REG_SZ, "Value1", 7, 0);
- verify_reg(hkey, "Line2", REG_SZ, "Value2", 7, 0);
- verify_reg(hkey, "Line3", REG_SZ, "Value3", 7, 0);
- verify_reg(hkey, "Line4", REG_SZ, "Value4", 7, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine1\"=dword:00000782\n\n"
- "\"Wine2\"=\"Test Value\"\n"
- "\"Wine3\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,63,00,6f,00,6e,00,63,00,\\\n"
- " 61,00,74,00,65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n"
- "#comment\n"
- "@=\"Test\"\n"
- ";comment\n\n"
- "\"Wine4\"=dword:12345678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x782;
- verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine2", REG_SZ, "Test Value", 11, 0);
- verify_reg(hkey, "Wine3", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "", REG_SZ, "Test", 5, 0);
- dword = 0x12345678;
- verify_reg(hkey, "Wine4", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_wstr("\xef\xbb\xbfREGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine5\"=\"No newline\"", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine5", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND /* WinXP */),
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine5", REG_SZ, "No newline", 11, 0);
- test_import_wstr("\xef\xbb\xbfREGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine6\"=dword:00000050\n\n"
- "\"Wine7\"=\"No newline\"", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x50;
- verify_reg(hkey, "Wine6", REG_DWORD, &dword, sizeof(dword), 0);
- err = RegQueryValueExA(hkey, "Wine7", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND /* WinXP */),
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine7", REG_SZ, "No newline", 11, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "#comment\\\n"
- "\"Wine8\"=\"Line 1\"\n"
- ";comment\\\n"
- "\"Wine9\"=\"Line 2\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine8", REG_SZ, "Line 1", 7, 0);
- verify_reg(hkey, "Wine9", REG_SZ, "Line 2", 7, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine10\"=\"Value 1\"#comment\n"
- "\"Wine11\"=\"Value 2\";comment\n"
- "\"Wine12\"=dword:01020304 #comment\n"
- "\"Wine13\"=dword:02040608 ;comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine10");
- verify_reg(hkey, "Wine11", REG_SZ, "Value 2", 8, 0);
- verify_reg_nonexist(hkey, "Wine12");
- dword = 0x2040608;
- verify_reg(hkey, "Wine13", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine14\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,63,00,6f,00,6e,00,63,00,\\\n"
- " #comment\n"
- " 61,00,74,00,65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n"
- "\"Wine15\"=\"A valid line\"\n"
- "\"Wine16\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,63,00,6f,00,6e,00,63,00,\\\n"
- " ;comment\n"
- " 61,00,74,00,65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n"
- "\"Wine17\"=\"Another valid line\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine14");
- verify_reg(hkey, "Wine15", REG_SZ, "A valid line", 13, 0);
- verify_reg(hkey, "Wine16", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "Wine17", REG_SZ, "Another valid line", 19, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "#\"Comment1\"=\"Value 1\"\n"
- ";\"Comment2\"=\"Value 2\"\n"
- " #\"Comment3\"=\"Value 3\"\n"
- " ;\"Comment4\"=\"Value 4\"\n"
- "\"Wine18\"=\"Value 6\"#\"Comment5\"=\"Value 5\"\n"
- "\"Wine19\"=\"Value 7\";\"Comment6\"=\"Value 6\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Comment1");
- verify_reg_nonexist(hkey, "Comment2");
- verify_reg_nonexist(hkey, "Comment3");
- verify_reg_nonexist(hkey, "Comment4");
- verify_reg_nonexist(hkey, "Wine18");
- verify_reg_nonexist(hkey, "Comment5");
- verify_reg(hkey, "Wine19", REG_SZ, "Value 7", 8, 0);
- verify_reg_nonexist(hkey, "Comment6");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine20\"=#\"Value 8\"\n"
- "\"Wine21\"=;\"Value 9\"\n"
- "\"Wine22\"=\"#comment1\"\n"
- "\"Wine23\"=\";comment2\"\n"
- "\"Wine24\"=\"Value#comment3\"\n"
- "\"Wine25\"=\"Value;comment4\"\n"
- "\"Wine26\"=\"Value #comment5\"\n"
- "\"Wine27\"=\"Value ;comment6\"\n"
- "\"Wine28\"=#dword:00000001\n"
- "\"Wine29\"=;dword:00000002\n"
- "\"Wine30\"=dword:00000003#comment\n"
- "\"Wine31\"=dword:00000004;comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine20");
- verify_reg_nonexist(hkey, "Wine21");
- verify_reg(hkey, "Wine22", REG_SZ, "#comment1", 10, 0);
- verify_reg(hkey, "Wine23", REG_SZ, ";comment2", 10, 0);
- verify_reg(hkey, "Wine24", REG_SZ, "Value#comment3", 15, 0);
- verify_reg(hkey, "Wine25", REG_SZ, "Value;comment4", 15, 0);
- verify_reg(hkey, "Wine26", REG_SZ, "Value #comment5", 16, 0);
- verify_reg(hkey, "Wine27", REG_SZ, "Value ;comment6", 16, 0);
- verify_reg_nonexist(hkey, "Wine28");
- verify_reg_nonexist(hkey, "Wine29");
- verify_reg_nonexist(hkey, "Wine30");
- dword = 0x00000004;
- verify_reg(hkey, "Wine31", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine32a\"=dword:1\n"
- "\"Wine32b\"=dword:4444\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x1;
- verify_reg(hkey, "Wine32a", REG_DWORD, &dword, sizeof(dword), 0);
- dword = 0x4444;
- verify_reg(hkey, "Wine32b", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine33a\"=dword:\n"
- "\"Wine33b\"=dword:hello\n"
- "\"Wine33c\"=dword:123456789\n"
- "\"Wine33d\"=dword:012345678\n"
- "\"Wine33e\"=dword:000000001\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine33a");
- verify_reg_nonexist(hkey, "Wine33b");
- verify_reg_nonexist(hkey, "Wine33c");
- verify_reg_nonexist(hkey, "Wine33d");
- verify_reg_nonexist(hkey, "Wine33e");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine34a\"=dword:12345678abc\n"
- "\"Wine34b\"=dword:12345678 abc\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine34a");
- verify_reg_nonexist(hkey, "Wine34b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine35a\"=dword:0x123\n"
- "\"Wine35b\"=dword:123 456\n"
- "\"Wine35c\"=dword:1234 5678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine35a");
- verify_reg_nonexist(hkey, "Wine35b");
- verify_reg_nonexist(hkey, "Wine35c");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine36a\"=dword:1234;5678\n"
- "\"Wine36b\"=dword:1234 ;5678\n"
- "\"Wine36c\"=dword:1234#5678\n"
- "\"Wine36d\"=dword:1234 #5678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x1234;
- verify_reg(hkey, "Wine36a", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine36b", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg_nonexist(hkey, "Wine36c");
- verify_reg_nonexist(hkey, "Wine36d");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine37a\"=\"foo\"bar\"\n"
- "\"Wine37b\"=\"foo\"\"bar\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine37a");
- verify_reg_nonexist(hkey, "Wine37b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Empty string\"=\"\"\n"
- "\"\"=\"Default registry value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Empty string", REG_SZ, "", 1, 0);
- verify_reg(hkey, NULL, REG_SZ, "Default registry value", 23, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Test38a\"=\n"
- "\"Test38b\"=\\\"\n"
- "\"Test38c\"=\\\"Value\\\"\n"
- "\"Test38d\"=\\\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Test38a");
- verify_reg_nonexist(hkey, "Test38b");
- verify_reg_nonexist(hkey, "Test38c");
- verify_reg_nonexist(hkey, "Test38d");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine39a\"=\"Value1\" ;comment\n"
- "\"Wine39b\"=\"Value2\"\t\t;comment\n"
- "\"Wine39c\"=\"Value3\" #comment\n"
- "\"Wine39d\"=\"Value4\"\t\t#comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine39a", REG_SZ, "Value1", 7, 0);
- verify_reg(hkey, "Wine39b", REG_SZ, "Value2", 7, 0);
- verify_reg_nonexist(hkey, "Wine39c");
- verify_reg_nonexist(hkey, "Wine39d");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"TestNoBeginQuote\"=Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "TestNoBeginQuote");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"TestNoEndQuote\"=\"Asdffdsa\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "TestNoEndQuote");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"TestNoQuotes\"=Asdffdsa\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "TestNoQuotes");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "NameNoBeginQuote\"=\"Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "NameNoBeginQuote");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"NameNoEndQuote=\"Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "NameNoEndQuote");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "NameNoQuotes=\"Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "NameNoQuotes");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"MixedQuotes=Asdffdsa\"\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "MixedQuotes");
- verify_reg_nonexist(hkey, "MixedQuotes=Asdffdsa");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine40a\"=hex(2):4c,00,69,00,6e,00,65,00,00,00\n"
- "\"Wine40b\"=\"Value 1\"\n"
- "\"Wine40c\"=hex(2):4c,00,69,00,6e,00,65,00\\\n"
- "\"Wine40d\"=\"Value 2\"\n"
- "\"Wine40e\"=hex(2):4c,00,69,00,6e,00,65,00,\\\n"
- "\"Wine40f\"=\"Value 3\"\n"
- "\"Wine40g\"=\"Value 4\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine40a", REG_EXPAND_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine40b", REG_SZ, "Value 1", 8, 0);
- verify_reg_nonexist(hkey, "Wine40c");
- verify_reg(hkey, "Wine40d", REG_SZ, "Value 2", 8, 0);
- verify_reg_nonexist(hkey, "Wine40e");
- verify_reg_nonexist(hkey, "Wine40f");
- verify_reg(hkey, "Wine40g", REG_SZ, "Value 4", 8, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line1\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,\\;comment\n"
- " 63,00,61,00,74,00,\\;comment\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line1", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line2\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,\\;comment\n"
- " 63,00,61,00,74,00,;comment\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line2", REG_MULTI_SZ, "Line concat", 12, 0);
- test_import_wstr("\xef\xbb\xbfREGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line3\"=hex(7):4c,69,6e,65,20\\\n"
- ",63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line3");
- test_import_wstr("\xef\xbb\xbfREGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line4\"=hex(7):4c,69,6e,65,20\\\n"
- " ,63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line4");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line5\"=hex(7):4c,69,6e,65,20\\\n"
- ",63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line5");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line6\"=hex(7):4c,69,6e,65,20\\\n"
- " ,63,6f,6e,63,61,74,65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line6");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line7\"=hex(7):4c,00,69,00,6e,00,\\;comment\n"
- " 65,00,20,00,\\;comment\n"
- " 63,00,6f,00,6e,00,\\;comment\n"
- " 63,00,61,00,74,00,\\;comment\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line7", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line8\"=hex(7):4c,00,69,00,6e,00,\\;#comment\n"
- " 65,00,20,00,\\;#comment\n"
- " 63,00,6f,00,6e,00,\\;#comment\n"
- " 63,00,61,00,74,00,\\;#comment\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line8", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line9\"=hex(7):4c,00,69,00,6e,00,\\;comment\n"
- " 65,00,20,00,\\;comment\n"
- " 63,00,6f,00,6e,00,\\;comment\n"
- " 63,00,61,00,74,00,\\#comment\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Multi-Line9");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Multi-Line10\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,\\;comment\n"
- " 63,00,61,00,74,00,\\\n\n"
- " 65,00,6e,00,\\;comment\n\n"
- " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Multi-Line10", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine41a\"=dword:1234\\\n"
- "5678\n"
- "\"Wine41b\"=\"Test \\\n"
- "Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine41a");
- verify_reg_nonexist(hkey, "Wine41b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"double\\\"quote\"=\"valid \\\"or\\\" not\"\n"
- "\"single'quote\"=dword:00000008\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "double\"quote", REG_SZ, "valid \"or\" not", 15, 0);
- dword = 0x00000008;
- verify_reg(hkey, "single'quote", REG_DWORD, &dword, sizeof(dword), 0);
- /* Test key name and value name concatenation */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\\n"
- "Subkey1]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey1");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\n"
- "\\Subkey2]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey2");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine\\\n"
- "42a\"=\"Value 1\"\n"
- "\"Wine42b\"=\"Value 2\"\n"
- "\"Wine\n"
- "\\42c\"=\"Value 3\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine42a");
- verify_reg(hkey, "Wine42b", REG_SZ, "Value 2", 8, 0);
- verify_reg_nonexist(hkey, "Wine42c");
- /* Test hex data concatenation for REG_NONE, REG_EXPAND_SZ and REG_BINARY */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine43a\"=hex(0):56,00,61,00,6c,00,75,00,65,00,00,00\n"
- "\"Wine43b\"=hex(0):56,00,61,00,6c,00,\\\n"
- " 75,00,65,00,00,00\n"
- "\"Wine43c\"=hex(0):56,00,61,00,6c,00\\\n"
- ",75,00,65,00,00,00\n"
- "\"Wine43d\"=hex(0):56,00,61,00,6c,00\\\n"
- " ,75,00,65,00,00,00\n"
- "\"Wine43e\"=hex(0):56,00,61,00,6c,00\\\n"
- " 75,00,65,00,00,00\n"
- "\"Wine43f\"=hex(0):56,00,61,00,6c,00,7\\\n"
- "5,00,65,00,00,00\n"
- "\"Wine43g\"=hex(0):56,00,61,00,6c,00,7\\\n"
- " 5,00,65,00,00,00\n"
- "\"Wine43h\"=hex(0):56,00,61,00,\\;comment\n"
- " 6c,00,75,00,\\\n"
- " 65,00,00,00\n"
- "\"Wine43i\"=hex(0):56,00,61,00,\\;comment\n"
- " 6c,00,75,00,\n"
- " 65,00,00,00\n"
- "\"Wine43j\"=hex(0):56,00,61,00,\\;comment\n"
- " 6c,00,75,00,;comment\n"
- " 65,00,00,00\n"
- "\"Wine43k\"=hex(0):56,00,61,00,\\;comment\n"
- " 6c,00,75,00,\\#comment\n"
- " 65,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine43a", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- verify_reg(hkey, "Wine43b", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- verify_reg_nonexist(hkey, "Wine43c");
- verify_reg_nonexist(hkey, "Wine43d");
- verify_reg_nonexist(hkey, "Wine43e");
- verify_reg_nonexist(hkey, "Wine43f");
- verify_reg_nonexist(hkey, "Wine43g");
- verify_reg(hkey, "Wine43h", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- verify_reg(hkey, "Wine43i", REG_NONE, "V\0a\0l\0u", 8, 0);
- verify_reg(hkey, "Wine43j", REG_NONE, "V\0a\0l\0u", 8, 0);
- verify_reg_nonexist(hkey, "Wine43k");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine44a\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine44b\"=hex(2):25,00,50,00,41,00,\\\n"
- " 54,00,48,00,25,00,00,00\n"
- "\"Wine44c\"=hex(2):25,00,50,00,41,00\\\n"
- ",54,00,48,00,25,00,00,00\n"
- "\"Wine44d\"=hex(2):25,00,50,00,41,00\\\n"
- " ,54,00,48,00,25,00,00,00\n"
- "\"Wine44e\"=hex(2):25,00,50,00,41,00\\\n"
- " 54,00,48,00,25,00,00,00\n"
- "\"Wine44f\"=hex(2):25,00,50,00,4\\\n"
- "1,00,54,00,48,00,25,00,00,00\n"
- "\"Wine44g\"=hex(2):25,00,50,00,4\\\n"
- " 1,00,54,00,48,00,25,00,00,00\n"
- "\"Wine44h\"=hex(2):25,00,50,00,41,00,\\;comment\n"
- " 54,00,48,00,\\\n"
- " 25,00,00,00\n"
- "\"Wine44i\"=hex(2):25,00,50,00,41,00,\\;comment\n"
- " 54,00,48,00\n"
- " 25,00,00,00\n"
- "\"Wine44j\"=hex(2):25,00,50,00,41,00,\\;comment\n"
- " 54,00,48,00;comment\n"
- " 25,00,00,00\n"
- "\"Wine44k\"=hex(2):25,00,50,00,41,00,\\;comment\n"
- " 54,00,48,00,\\#comment\n"
- " 25,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine44a", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine44b", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg_nonexist(hkey, "Wine44c");
- verify_reg_nonexist(hkey, "Wine44d");
- verify_reg_nonexist(hkey, "Wine44e");
- verify_reg_nonexist(hkey, "Wine44f");
- verify_reg_nonexist(hkey, "Wine44g");
- verify_reg(hkey, "Wine44h", REG_EXPAND_SZ, "%PATH%", 7, 0);
- /* Wine44i */
- size = sizeof(buffer);
- err = RegQueryValueExA(hkey, "Wine44i", NULL, &type, (BYTE *)&buffer, &size);
- ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
- ok(type == REG_EXPAND_SZ, "got wrong type %u, expected %u\n", type, REG_EXPAND_SZ);
- ok(size == 6 || broken(size == 5) /* WinXP */, "got wrong size %u, expected 6\n", size);
- ok(memcmp(buffer, "%PATH", size) == 0, "got wrong data\n");
- /* Wine44j */
- size = sizeof(buffer);
- memset(buffer, '-', size);
- err = RegQueryValueExA(hkey, "Wine44j", NULL, &type, (BYTE *)&buffer, &size);
- ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
- ok(type == REG_EXPAND_SZ, "got wrong type %u, expected %u\n", type, REG_EXPAND_SZ);
- ok(size == 6 || broken(size == 5) /* WinXP */, "got wrong size %u, expected 6\n", size);
- ok(memcmp(buffer, "%PATH", size) == 0, "got wrong data\n");
- /* Wine44k */
- verify_reg_nonexist(hkey, "Wine44k");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine45a\"=hex:11,22,33,44,55,66,77,88\n"
- "\"Wine45b\"=hex:11,22,33,44,\\\n"
- " 55,66,77,88\n"
- "\"Wine45c\"=hex:11,22,33,44\\\n"
- ",55,66,77,88\n"
- "\"Wine45d\"=hex:11,22,33,44\\\n"
- " ,55,66,77,88\n"
- "\"Wine45e\"=hex:11,22,33,44\\\n"
- " 55,66,77,88\n"
- "\"Wine45f\"=hex:11,22,33,4\\\n"
- "4,55,66,77,88\n"
- "\"Wine45g\"=hex:11,22,33,4\\\n"
- " 4,55,66,77,88\n"
- "\"Wine45h\"=hex:11,22,33,44,\\;comment\n"
- " 55,66,\\\n"
- " 77,88\n"
- "\"Wine45i\"=hex:11,22,33,44,\\;comment\n"
- " 55,66,\n"
- " 77,88\n"
- "\"Wine45j\"=hex:11,22,33,44,\\;comment\n"
- " 55,66,;comment\n"
- " 77,88\n"
- "\"Wine45k\"=hex:11,22,33,\\;comment\n"
- " 44,55,66,\\#comment\n"
- " 77,88\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- hex[0] = 0x11; hex[1] = 0x22; hex[2] = 0x33; hex[3] = 0x44;
- hex[4] = 0x55; hex[5] = 0x66; hex[6] = 0x77; hex[7] = 0x88;
- verify_reg(hkey, "Wine45a", REG_BINARY, hex, sizeof(hex), 0);
- verify_reg(hkey, "Wine45b", REG_BINARY, hex, sizeof(hex), 0);
- verify_reg_nonexist(hkey, "Wine45c");
- verify_reg_nonexist(hkey, "Wine45d");
- verify_reg_nonexist(hkey, "Wine45e");
- verify_reg_nonexist(hkey, "Wine45f");
- verify_reg_nonexist(hkey, "Wine45g");
- verify_reg(hkey, "Wine45h", REG_BINARY, hex, sizeof(hex), 0);
- verify_reg(hkey, "Wine45i", REG_BINARY, hex, 6, 0);
- verify_reg(hkey, "Wine45j", REG_BINARY, hex, 6, 0);
- verify_reg_nonexist(hkey, "Wine45k");
- /* Test import with subkeys */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey\"1]\n"
- "\"Wine\\\\31\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- open_key(hkey, "Subkey\"1", 0, &subkey);
- verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0);
- close_key(subkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n"
- "\"123/\\\"4;'5\"=\"Random value name\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- open_key(hkey, "Subkey/2", 0, &subkey);
- verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0);
- close_key(subkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2");
- /* Test key creation */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "HKEY_CURRENT_USER\\" KEY_BASE "\\No_Opening_Bracket]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "No_Opening_Bracket");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\No_Closing_Bracket\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "No_Closing_Bracket");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[ HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1a]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey1a");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[\tHKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1b]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey1b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1c ");
- delete_key(hkey, "Subkey1c ");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1d\t");
- delete_key(hkey, "Subkey1d\t");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n"
- "\"Wine\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1e\\");
- verify_key(hkey, "Subkey1e");
- open_key(hkey, "Subkey1e", 0, &subkey);
- verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
- close_key(subkey);
- delete_key(hkey, "Subkey1e");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n"
- "\"Wine\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1f\\\\");
- verify_key(hkey, "Subkey1f\\");
- verify_key(hkey, "Subkey1f");
- open_key(hkey, "Subkey1f\\\\", 0, &subkey);
- verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
- close_key(subkey);
- delete_key(hkey, "Subkey1f\\\\");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n"
- "\"Wine\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey1g\\\\\\\\");
- verify_key(hkey, "Subkey1g\\\\");
- verify_key(hkey, "Subkey1g\\");
- verify_key(hkey, "Subkey1g");
- open_key(hkey, "Subkey1g\\\\", 0, &subkey);
- verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0);
- close_key(subkey);
- delete_key(hkey, "Subkey1g\\\\");
- /* Test key deletion. We start by creating some registry keys. */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2a");
- verify_key(hkey, "Subkey2b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[ -HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2a");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[\t-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[- HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2a");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[-\tHKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey2b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n\n"
- "[-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey2a");
- verify_key_nonexist(hkey, "Subkey2b");
- /* Test case sensitivity when creating and deleting registry keys. */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[hkey_CURRENT_user\\" KEY_BASE "\\Subkey3a]\n\n"
- "[HkEy_CuRrEnT_uSeR\\" KEY_BASE "\\SuBkEy3b]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey3a");
- verify_key(hkey, "Subkey3b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[-HKEY_current_USER\\" KEY_BASE "\\sUBKEY3A]\n\n"
- "[-hKeY_cUrReNt_UsEr\\" KEY_BASE "\\sUbKeY3B]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey3a");
- verify_key_nonexist(hkey, "Subkey3b");
- /* Test mixed key creation and deletion. We start by creating a subkey. */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey4a]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key(hkey, "Subkey4a");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"
- "[-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey4a]\n"
- "\"Wine46a\"=dword:12345678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey4a");
- verify_reg_nonexist(hkey, "Wine46a");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n"
- "[HKEY_CURRENT_USERS\\" KEY_BASE "\\Subkey4b]\n"
- "\"Wine46b\"=dword:12345678\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_key_nonexist(hkey, "Subkey4b");
- verify_reg_nonexist(hkey, "Wine46b");
- /* Test value deletion. We start by creating some registry values. */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine46a\"=\"Test Value\"\n"
- "\"Wine46b\"=dword:00000008\n"
- "\"Wine46c\"=hex:11,22,33,44\n"
- "\"Wine46d\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,\\\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n"
- "\"Wine46e\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine46f\"=hex(0):56,00,61,00,6c,00,75,00,65,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine46a", REG_SZ, "Test Value", 11, 0);
- verify_reg(hkey, "Wine46b", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine46c", REG_BINARY, hex, 4, 0);
- verify_reg(hkey, "Wine46d", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "Wine46e", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine46f", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine46a\"=-\n"
- "\"Wine46b\"= -\n"
- "\"Wine46c\"= \t-\t \n"
- "\"Wine46d\"=-\"Test\"\n"
- "\"Wine46e\"=- ;comment\n"
- "\"Wine46f\"=- #comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine46a");
- verify_reg_nonexist(hkey, "Wine46b");
- verify_reg_nonexist(hkey, "Wine46c");
- verify_reg(hkey, "Wine46d", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg_nonexist(hkey, "Wine46e");
- verify_reg(hkey, "Wine46f", REG_NONE, "V\0a\0l\0u\0e\0\0", 12, 0);
- /* Test the accepted range of the hex-based data types */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine47a\"=hex(0):56,61,6c,75,65,00\n"
- "\"Wine47b\"=hex(10):56,61,6c,75,65,00\n"
- "\"Wine47c\"=hex(100):56,61,6c,75,65,00\n"
- "\"Wine47d\"=hex(1000):56,61,6c,75,65,00\n"
- "\"Wine47e\"=hex(7fff):56,61,6c,75,65,00\n"
- "\"Wine47f\"=hex(ffff):56,61,6c,75,65,00\n"
- "\"Wine47g\"=hex(7fffffff):56,61,6c,75,65,00\n"
- "\"Wine47h\"=hex(ffffffff):56,61,6c,75,65,00\n"
- "\"Wine47i\"=hex(100000000):56,61,6c,75,65,00\n"
- "\"Wine47j\"=hex(0x2):56,00,61,00,6c,00,75,00,65,00,00,00\n"
- "\"Wine47k\"=hex(0X2):56,00,61,00,6c,00,75,00,65,00,00,00\n"
- "\"Wine47l\"=hex(x2):56,00,61,00,6c,00,75,00,65,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine47a", REG_NONE, "Value", 6, 0);
- verify_reg(hkey, "Wine47b", 0x10, "Value", 6, 0);
- verify_reg(hkey, "Wine47c", 0x100, "Value", 6, 0);
- verify_reg(hkey, "Wine47d", 0x1000, "Value", 6, 0);
- verify_reg(hkey, "Wine47e", 0x7fff, "Value", 6, 0);
- verify_reg(hkey, "Wine47f", 0xffff, "Value", 6, 0);
- verify_reg(hkey, "Wine47g", 0x7fffffff, "Value", 6, 0);
- verify_reg(hkey, "Wine47h", 0xffffffff, "Value", 6, 0);
- verify_reg_nonexist(hkey, "Wine47i");
- verify_reg_nonexist(hkey, "Wine47j");
- verify_reg_nonexist(hkey, "Wine47k");
- verify_reg_nonexist(hkey, "Wine47l");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine48a\"=hex(7):4c,00,69,00,6e,00,65,00,20,00, \\\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00, \\\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n"
- "\"Wine48b\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\t\\\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,\t \t \\\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine48a", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "Wine48b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine49\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00,\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine49", REG_EXPAND_SZ, "%PATH%", 7, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine50a\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00 ;comment\n"
- "\"Wine50b\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\t;comment\n"
- "\"Wine50c\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00 #comment\n"
- "\"Wine50d\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\t#comment\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine50a", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine50b", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg_nonexist(hkey, "Wine50c");
- verify_reg_nonexist(hkey, "Wine50d");
- /* Test support for characters greater than 0xff */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine51a\"=hex(0):25,50,100,54,48,25,00\n"
- "\"Wine51b\"=hex(0):25,1a4,100,164,124,25,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine51a");
- verify_reg_nonexist(hkey, "Wine51b");
- /* Test the effect of backslashes in hex data */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine52a\"=hex(2):25,00,48\\,00,4f,00,4d,00,45,00,25,00,00,00\n"
- "\"Wine52b\"=hex(2):25,00,48,00,\\4f,00,4d,00,45,00,25,00,00,00\n"
- "\"Wine52c\"=hex(2):25,00,48\\ ,00,4f,00,4d,00,45,00,25,00,00,00\n"
- "\"Wine52d\"=hex(2):25,00,48,00,\\ 4f,00,4d,00,45,00,25,00,00,00\n"
- "\"Wine52e\"=hex(2):\\25,00,48,00,4f,00,4d,00,45,00,25,00,00,00\n"
- "\"Wine52f\"=hex(2):\\ 25,00,48,00,4f,00,4d,00,45,00,25,00,00,00\n"
- "\"Wine52g\"=hex(2):25,00,48,00,4\\f,00,4d,00,45,00,25,00,00,00\n"
- "\"Wine52h\"=hex(2):25,00,48,00,4\\\n"
- " f,00,4d,00,45,00,25,00,00,00\n"
- "\"Wine52i\"=hex(2):25,00,50,00,\\,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine52j\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,\\\\\n"
- " 25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine52k\"=hex(2):,\\\n"
- " 25,00,48,00,4f,00,4d,00,45,00,25,00,00,00\n"
- "\"Wine52l\"=hex(2):\\\n"
- " 25,00,48,00,4f,00,4d,00,45,00,25,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine52a");
- verify_reg_nonexist(hkey, "Wine52b");
- verify_reg_nonexist(hkey, "Wine52c");
- verify_reg_nonexist(hkey, "Wine52d");
- verify_reg_nonexist(hkey, "Wine52e");
- verify_reg_nonexist(hkey, "Wine52f");
- verify_reg_nonexist(hkey, "Wine52g");
- verify_reg_nonexist(hkey, "Wine52h");
- verify_reg_nonexist(hkey, "Wine52i");
- verify_reg_nonexist(hkey, "Wine52j");
- verify_reg_nonexist(hkey, "Wine52k");
- verify_reg(hkey, "Wine52l", REG_EXPAND_SZ, "%HOME%", 7, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine53a\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,\\\n"
- " 25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine53b\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00\\\n"
- " 25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine53c\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00, \\ ;comment\n"
- " 25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine53d\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00 \\ ;comment\n"
- " 25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine53e\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,\\\t ;comment\n"
- " 25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine53f\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00\\\t ;comment\n"
- " 25,00,50,00,41,00,54,00,48,00,25,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine53a", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14, 0);
- verify_reg_nonexist(hkey, "Wine53b");
- verify_reg(hkey, "Wine53c", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14, 0);
- verify_reg_nonexist(hkey, "Wine53d");
- verify_reg(hkey, "Wine53e", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14, 0);
- verify_reg_nonexist(hkey, "Wine53f");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine54a\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine54a");
- verify_key_nonexist(hkey, "Subkey1");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine54b\"=hex(2):4c,00,69,00,6e,00,65,00,20,00\\\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2]\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine54b");
- verify_key(hkey, "Subkey2");
- delete_key(hkey, "Subkey2");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine55a\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- "\"Wine55b\"=\"Test value\"\n"
- "\"Wine55c\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- ";comment\n"
- "\"Wine55d\"=\"Test value\"\n"
- "\"Wine55e\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- "#comment\n"
- "\"Wine55f\"=\"Test value\"\n"
- "\"Wine55g\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n\n"
- "\"Wine55h\"=\"Test value\"\n"
- "\"Wine55i\"=hex(2):4c,00,69,00,6e,00,65,00,20,00\\\n"
- "\"Wine55j\"=\"Test value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine55a");
- verify_reg_nonexist(hkey, "Wine55b");
- verify_reg_nonexist(hkey, "Wine55c");
- verify_reg_nonexist(hkey, "Wine55d");
- verify_reg_nonexist(hkey, "Wine55e");
- verify_reg(hkey, "Wine55f", REG_SZ, "Test value", 11, 0);
- verify_reg_nonexist(hkey, "Wine55g");
- verify_reg_nonexist(hkey, "Wine55h");
- verify_reg_nonexist(hkey, "Wine55i");
- verify_reg(hkey, "Wine55j", REG_SZ, "Test value", 11, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine56a\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- "\"Wine56b\"=dword:00000008\n"
- "\"Wine56c\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- ";comment\n"
- "\"Wine56d\"=dword:00000008\n"
- "\"Wine56e\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- "#comment\n"
- "\"Wine56f\"=dword:00000008\n"
- "\"Wine56g\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n\n"
- "\"Wine56h\"=dword:00000008\n"
- "\"Wine56i\"=hex(2):4c,00,69,00,6e,00,65,00,20,00\\\n"
- "\"Wine56j\"=dword:00000008\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine56a");
- verify_reg_nonexist(hkey, "Wine56b");
- verify_reg_nonexist(hkey, "Wine56c");
- verify_reg_nonexist(hkey, "Wine56d");
- verify_reg_nonexist(hkey, "Wine56e");
- verify_reg(hkey, "Wine56f", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg_nonexist(hkey, "Wine56g");
- verify_reg_nonexist(hkey, "Wine56h");
- verify_reg_nonexist(hkey, "Wine56i");
- verify_reg(hkey, "Wine56j", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine57a\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,\\\n"
- "\"Wine57b\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine57c\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,\\\n"
- ";comment\n"
- "\"Wine57d\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine57e\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,\\\n"
- "#comment\n"
- "\"Wine57f\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine57g\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00,\\\n\n"
- "\"Wine57h\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine57i\"=hex(2):25,00,48,00,4f,00,4d,00,45,00,25,00,5c,00\\\n"
- "\"Wine57j\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine57a");
- verify_reg_nonexist(hkey, "Wine57b");
- verify_reg_nonexist(hkey, "Wine57c");
- verify_reg_nonexist(hkey, "Wine57d");
- verify_reg_nonexist(hkey, "Wine57e");
- verify_reg(hkey, "Wine57f", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg_nonexist(hkey, "Wine57g");
- verify_reg_nonexist(hkey, "Wine57h");
- verify_reg_nonexist(hkey, "Wine57i");
- verify_reg(hkey, "Wine57j", REG_EXPAND_SZ, "%PATH%", 7, 0);
- delete_value(hkey, NULL);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58a\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- "@=\"Default value 1\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58a");
- verify_reg_nonexist(hkey, NULL);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58b\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- ";comment\n"
- "@=\"Default value 2\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58b");
- verify_reg_nonexist(hkey, NULL);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58c\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- "#comment\n"
- "@=\"Default value 3\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58c");
- verify_reg(hkey, NULL, REG_SZ, "Default value 3", 16, 0);
- delete_value(hkey, NULL);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58d\"=hex(2):4c,00,69,00,6e,00,65,00,20,00,\\\n\n"
- "@=\"Default value 4\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58d");
- verify_reg_nonexist(hkey, NULL);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine58e\"=hex(2):4c,00,69,00,6e,00,65,00,20,00\\\n"
- "@=\"Default value 5\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine58e");
- verify_reg(hkey, NULL, REG_SZ, "Default value 5", 16, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine59a\"=hex:11,22,33,\\\n"
- "\\\n"
- " 44,55,66\n"
- "\"Wine59b\"=hex:11,22,33,\\\n"
- " \\\n"
- " 44,55,66\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine59a");
- verify_reg_nonexist(hkey, "Wine59b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60a\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,\\\n"
- ";comment\n"
- " 65,00,6e,00,\\;comment\n"
- " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine60a", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60b\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,\\\n"
- " ;comment\n"
- " 65,00,6e,00,\\;comment\n"
- " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine60b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60c\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,\\\n"
- "#comment\n"
- " 65,00,6e,00,\\;comment\n"
- " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine60c");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60d\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,\\\n"
- " #comment\n"
- " 65,00,6e,00,\\;comment\n"
- " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine60d");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60e\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,\\\n\n"
- " 63,00,61,00,74,00,\\\n\n\n"
- " 65,00,6e,00,\\\n\n\n\n"
- " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine60e", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine60f\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,\\\n \n"
- " 63,00,61,00,74,00,\\\n\t\n\t\n"
- " 65,00,6e,00,\\\n\t \t\n\t \t\n\t \t\n"
- " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine60f", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine61a\"=hex(0):25,48,4f,4d,45,25,5c,/\n"
- " 25,50,41,54,48,25,00\n"
- "\"Wine61b\"=hex(0):25,48,4f,4d,45,25,5c/\n"
- " 25,50,41,54,48,25,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine61a");
- verify_reg_nonexist(hkey, "Wine61b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62a\"=hex(0):56,61,6c,75,65,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62a", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62a", REG_NONE, "Value", 5, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62b\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62b", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62b", REG_EXPAND_SZ, "%PATH%", 7, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62c\"=hex:11,22,33,44,55,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62c", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62c", REG_BINARY, hex, 5, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62d\"=hex(7):4c,00,69,00,6e,00,65,00,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62d", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62d", REG_MULTI_SZ, "Line", 5, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62e\"=hex(100):56,61,6c,75,65,\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- err = RegQueryValueExA(hkey, "Wine62e", NULL, NULL, NULL, NULL);
- ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND) /* WinXP */,
- "got exit code %d, expected 0\n", err);
- if (err == ERROR_SUCCESS)
- verify_reg(hkey, "Wine62e", 0x100, "Value", 5, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine62f\"=hex(7):4c,00,69,00,6e,00,65,00,20,00\\", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine62f");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine63a\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " ,63,00,6f,00,6e,00,\\\n"
- " 63,00,61,00,74,00,\\\n"
- " 65,00,6e,00,\\\n"
- " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n"
- "\"Wine63b\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,,00,6f,00,6e,00,\\\n"
- " 63,00,61,00,74,00,\\\n"
- " 65,00,6e,00,\\\n"
- " 61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine63a");
- verify_reg_nonexist(hkey, "Wine63b");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine64a\"=hex(7):4c,00,69,00,6e,00,65,00,00,00,00,00\n"
- "\"Wine64b\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,\\\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n"
- "\"Wine64c\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\;comment\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,\\\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n"
- "\"Wine64d\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\;comment\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n"
- "\"Wine64e\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,63,00,61,00,74,00,;comment\n"
- " 65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine64a", REG_MULTI_SZ, "Line\0", 6, 0);
- verify_reg(hkey, "Wine64b", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- verify_reg(hkey, "Wine64c", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- /* Wine64d */
- size = sizeof(buffer);
- err = RegQueryValueExA(hkey, "Wine64d", NULL, &type, (BYTE *)&buffer, &size);
- ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
- ok(type == REG_MULTI_SZ, "got wrong type %u, expected %u\n", type, REG_MULTI_SZ);
- ok(size == 12 || broken(size == 11) /* WinXP */, "got wrong size %u, expected 12\n", size);
- ok(memcmp(buffer, "Line concat", size) == 0, "got wrong data\n");
- /* Wine64e */
- size = sizeof(buffer);
- err = RegQueryValueExA(hkey, "Wine64e", NULL, &type, (BYTE *)&buffer, &size);
- ok(err == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", err);
- ok(type == REG_MULTI_SZ, "got wrong type %u, expected %u\n", type, REG_MULTI_SZ);
- ok(size == 12 || broken(size == 11) /* WinXP */, "got wrong size %u, expected 12\n", size);
- ok(memcmp(buffer, "Line concat", size) == 0, "got wrong data\n");
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine65a\"=hex(100):25,50,41,54,48,25,00\n"
- "\"Wine65b\"=hex(100):25,50,41,\\\n"
- " 54,48,25,00\n"
- "\"Wine65c\"=hex(100):25,50,41,\\;comment\n"
- " 54,48,\\\n"
- " 25,00\n"
- "\"Wine65d\"=hex(100):25,50,41,\\;comment\n"
- " 54,48,\n"
- " 25,00\n"
- "\"Wine65e\"=hex(100):25,50,41,\\;comment\n"
- " 54,48,;comment\n"
- " 25,00\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine65a", 0x100, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine65b", 0x100, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine65c", 0x100, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine65d", 0x100, "%PATH", 5, 0);
- verify_reg(hkey, "Wine65e", 0x100, "%PATH", 5, 0);
- /* Test null-termination of REG_EXPAND_SZ and REG_MULTI_SZ data*/
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine66a\"=hex(7):4c,00,69,00,6e,00,65,00\n"
- "\"Wine66b\"=hex(7):4c,00,69,00,6e,00,65,00,\n"
- "\"Wine66c\"=hex(7):4c,00,69,00,6e,00,65,00,00,00\n"
- "\"Wine66d\"=hex(7):4c,00,69,00,6e,00,65,00,00,00,\n"
- "\"Wine66e\"=hex(7):4c,00,69,00,6e,00,65,00,00,00,00,00\n"
- "\"Wine66f\"=hex(7):4c,00,69,00,6e,00,65,00,00,00,00,00,\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine66a", REG_MULTI_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine66b", REG_MULTI_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine66c", REG_MULTI_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine66d", REG_MULTI_SZ, "Line", 5, 0);
- verify_reg(hkey, "Wine66e", REG_MULTI_SZ, "Line\0", 6, 0);
- verify_reg(hkey, "Wine66f", REG_MULTI_SZ, "Line\0", 6, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine67a\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00\n"
- "\"Wine67b\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,\n"
- "\"Wine67c\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00\n"
- "\"Wine67d\"=hex(2):25,00,50,00,41,00,54,00,48,00,25,00,00,00,\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine67a", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine67b", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine67c", REG_EXPAND_SZ, "%PATH%", 7, 0);
- verify_reg(hkey, "Wine67d", REG_EXPAND_SZ, "%PATH%", 7, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine68a\"=hex(1):\n"
- "\"Wine68b\"=hex(2):\n"
- "\"Wine68c\"=hex(3):\n"
- "\"Wine68d\"=hex(4):\n"
- "\"Wine68e\"=hex(7):\n"
- "\"Wine68f\"=hex(100):\n"
- "\"Wine68g\"=hex(abcd):\n"
- "\"Wine68h\"=hex:\n"
- "\"Wine68i\"=hex(0):\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine68a", REG_SZ, NULL, 0, 0);
- verify_reg(hkey, "Wine68b", REG_EXPAND_SZ, NULL, 0, 0);
- verify_reg(hkey, "Wine68c", REG_BINARY, NULL, 0, 0);
- verify_reg(hkey, "Wine68d", REG_DWORD, NULL, 0, 0);
- verify_reg(hkey, "Wine68e", REG_MULTI_SZ, NULL, 0, 0);
- verify_reg(hkey, "Wine68f", 0x100, NULL, 0, 0);
- verify_reg(hkey, "Wine68g", 0xabcd, NULL, 0, 0);
- verify_reg(hkey, "Wine68h", REG_BINARY, NULL, 0, 0);
- verify_reg(hkey, "Wine68i", REG_NONE, NULL, 0, 0);
- /* Test with embedded null characters */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine69a\"=\"\\\\0\"\n"
- "\"Wine69b\"=\"\\\\0\\\\0\"\n"
- "\"Wine69c\"=\"Value1\\\\0\"\n"
- "\"Wine69d\"=\"Value2\\\\0\\\\0\\\\0\\\\0\"\n"
- "\"Wine69e\"=\"Value3\\\\0Value4\"\n"
- "\"Wine69f\"=\"\\\\0Value5\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine69a", REG_SZ, "\\0", 3, 0);
- verify_reg(hkey, "Wine69b", REG_SZ, "\\0\\0", 5, 0);
- verify_reg(hkey, "Wine69c", REG_SZ, "Value1\\0", 9, 0);
- verify_reg(hkey, "Wine69d", REG_SZ, "Value2\\0\\0\\0\\0", 15, 0);
- verify_reg(hkey, "Wine69e", REG_SZ, "Value3\\0Value4", 15, 0);
- verify_reg(hkey, "Wine69f", REG_SZ, "\\0Value5", 9, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine70a\"=\"\\0\"\n"
- "\"Wine70b\"=\"\\0\\0\"\n"
- "\"Wine70c\"=\"Value1\\0\"\n"
- "\"Wine70d\"=\"Value2\\0\\0\\0\\0\"\n"
- "\"Wine70e\"=\"Value3\\0Value4\"\n"
- "\"Wine70f\"=\"\\0Value5\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "Wine70a");
- verify_reg_nonexist(hkey, "Wine70b");
- verify_reg_nonexist(hkey, "Wine70c");
- verify_reg_nonexist(hkey, "Wine70d");
- verify_reg_nonexist(hkey, "Wine70e");
- verify_reg_nonexist(hkey, "Wine70f");
- /* Test forward and back slashes */
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"count/up\"=\"one/two/three\"\n"
- "\"\\\\foo\\\\bar\"=\"\"\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "\\https://winehq.org]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "count/up", REG_SZ, "one/two/three", 14, 0);
- verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0);
- verify_key(hkey, "https://winehq.org");
- close_key(hkey);
- delete_tree(HKEY_CURRENT_USER, KEY_BASE);
- }
- static void test_import_with_whitespace(void)
- {
- HKEY hkey;
- DWORD r, dword;
- delete_tree(HKEY_CURRENT_USER, KEY_BASE);
- verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
- test_import_str(" REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey);
- test_import_str(" REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine1a\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine1a", REG_SZ, "Value", 6, 0);
- test_import_str("\tREGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine1b\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine1b", REG_SZ, "Value", 6, 0);
- test_import_str(" \t REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine1c\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine1c", REG_SZ, "Value", 6, 0);
- test_import_str("REGEDIT4\n\n"
- " [HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine2a\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine2a", REG_SZ, "Value", 6, 0);
- test_import_str("REGEDIT4\n\n"
- "\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine2b\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine2b", REG_SZ, "Value", 6, 0);
- test_import_str("REGEDIT4\n\n"
- " \t [HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine2c\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine2c", REG_SZ, "Value", 6, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- " \"Wine3a\"=\"Two leading spaces\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine3a", REG_SZ, "Two leading spaces", 19, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\t\"Wine3b\"=\"One leading tab\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine3b", REG_SZ, "One leading tab", 16, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- " \t \"Wine3c\"=\"Space, tab, space\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine3c", REG_SZ, "Space, tab, space", 18, 0);
- test_import_str(" REGEDIT4\n\n"
- "\t\t\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\t \"Wine4a\"=\"Tab and four spaces\"\n"
- " \"Wine4b\"=dword:00112233\n"
- "\t \t \t \t \t \t \"Wine4c\"=hex(7):4c,69,6e,65,20,\\\n"
- " 63,6f,6e,\\;comment\n"
- "\t\t\t\t63,61,74,\\;comment\n"
- " \t65,6e,61,74,69,6f,6e,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine4a", REG_SZ, "Tab and four spaces", 20, 0);
- dword = 0x112233;
- verify_reg(hkey, "Wine4b", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine4c", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_str(" REGEDIT4\n\n"
- "\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- " \"Wine5a\"=\"Leading spaces\"\n"
- "\t\t\"Wine5b\"\t\t=\"Leading tabs\"\n"
- "\t \"Wine5c\"=\t \"Tabs and spaces\"\n"
- " \"Wine5d\" \t = \t \"More whitespace\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine5a", REG_SZ, "Leading spaces", 15, 0);
- verify_reg(hkey, "Wine5b", REG_SZ, "Leading tabs", 13, 0);
- verify_reg(hkey, "Wine5c", REG_SZ, "Tabs and spaces", 16, 0);
- verify_reg(hkey, "Wine5d", REG_SZ, "More whitespace", 16, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\" Wine6a\"=\"Leading spaces\"\n"
- "\"\t\tWine6b\"=\"Leading tabs\"\n"
- " \" Wine6c \" = \" Spaces everywhere \" \n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, " Wine6a", REG_SZ, "Leading spaces", 15, 0);
- verify_reg(hkey, "\t\tWine6b", REG_SZ, "Leading tabs", 13, 0);
- verify_reg(hkey, " Wine6c ", REG_SZ, " Spaces everywhere ", 22, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine7a\"=\" Four spaces in the data\"\n"
- "\"Wine7b\"=\"\t\tTwo tabs in the data\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine7a", REG_SZ, " Four spaces in the data", 28, 0);
- verify_reg(hkey, "Wine7b", REG_SZ, "\t\tTwo tabs in the data", 23, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine8a\"=\"Trailing spaces\" \n"
- "\"Wine8b\"=\"Trailing tabs and spaces\"\t \t\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine8a", REG_SZ, "Trailing spaces", 16, 0);
- verify_reg(hkey, "Wine8b", REG_SZ, "Trailing tabs and spaces", 25, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine9a\"=dword: 00000008\n"
- "\"Wine9b\"=dword:\t\t00000008\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x00000008;
- verify_reg(hkey, "Wine9a", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine9b", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "@ = \"Test Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Test Value", 11, 0);
- test_import_str("REGEDIT4\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\t@\t=\tdword:\t00000008\t\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_DWORD, &dword, sizeof(DWORD), 0);
- close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
- }
- static void test_unicode_import_with_whitespace(void)
- {
- HKEY hkey;
- DWORD r, dword;
- delete_tree(HKEY_CURRENT_USER, KEY_BASE);
- verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
- test_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey);
- test_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine1a\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine1a", REG_SZ, "Value", 6, 0);
- test_import_wstr("\xef\xbb\xbf\tWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine1b\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine1b", REG_SZ, "Value", 6, 0);
- test_import_wstr("\xef\xbb\xbf \t Windows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine1c\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine1c", REG_SZ, "Value", 6, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- " [HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine2a\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine2a", REG_SZ, "Value", 6, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine2b\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine2b", REG_SZ, "Value", 6, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- " \t [HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine2c\"=\"Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine2c", REG_SZ, "Value", 6, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- " \"Wine3a\"=\"Two leading spaces\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine3a", REG_SZ, "Two leading spaces", 19, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\t\"Wine3b\"=\"One leading tab\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine3b", REG_SZ, "One leading tab", 16, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- " \t \"Wine3c\"=\"Space, tab, space\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine3c", REG_SZ, "Space, tab, space", 18, 0);
- test_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n"
- "\t\t\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\t \"Wine4a\"=\"Tab and four spaces\"\n"
- " \"Wine4b\"=dword:00112233\n"
- "\t \t \t \t \t \t \"Wine4c\"=hex(7):4c,00,69,00,6e,00,65,00,20,00,\\\n"
- " 63,00,6f,00,6e,00,\\;comment\n"
- "\t\t\t\t63,00,61,00,74,00,\\;comment\n"
- " \t65,00,6e,00,61,00,74,00,69,00,6f,00,6e,00,00,00,00,00\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine4a", REG_SZ, "Tab and four spaces", 20, 0);
- dword = 0x112233;
- verify_reg(hkey, "Wine4b", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine4c", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
- test_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n"
- "\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- " \"Wine5a\"=\"Leading spaces\"\n"
- "\t\t\"Wine5b\"\t\t=\"Leading tabs\"\n"
- "\t \"Wine5c\"=\t \"Tabs and spaces\"\n"
- " \"Wine5d\" \t = \t \"More whitespace\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine5a", REG_SZ, "Leading spaces", 15, 0);
- verify_reg(hkey, "Wine5b", REG_SZ, "Leading tabs", 13, 0);
- verify_reg(hkey, "Wine5c", REG_SZ, "Tabs and spaces", 16, 0);
- verify_reg(hkey, "Wine5d", REG_SZ, "More whitespace", 16, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\" Wine6a\"=\"Leading spaces\"\n"
- "\"\t\tWine6b\"=\"Leading tabs\"\n"
- " \" Wine6c \" = \" Spaces everywhere \" \n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, " Wine6a", REG_SZ, "Leading spaces", 15, 0);
- verify_reg(hkey, "\t\tWine6b", REG_SZ, "Leading tabs", 13, 0);
- verify_reg(hkey, " Wine6c ", REG_SZ, " Spaces everywhere ", 22, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine7a\"=\" Four spaces in the data\"\n"
- "\"Wine7b\"=\"\t\tTwo tabs in the data\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine7a", REG_SZ, " Four spaces in the data", 28, 0);
- verify_reg(hkey, "Wine7b", REG_SZ, "\t\tTwo tabs in the data", 23, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine8a\"=\"Trailing spaces\" \n"
- "\"Wine8b\"=\"Trailing tabs and spaces\"\t \t\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "Wine8a", REG_SZ, "Trailing spaces", 16, 0);
- verify_reg(hkey, "Wine8b", REG_SZ, "Trailing tabs and spaces", 25, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\"Wine9a\"=dword: 00000008\n"
- "\"Wine9b\"=dword:\t\t00000008\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- dword = 0x00000008;
- verify_reg(hkey, "Wine9a", REG_DWORD, &dword, sizeof(dword), 0);
- verify_reg(hkey, "Wine9b", REG_DWORD, &dword, sizeof(dword), 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "@ = \"Test Value\"\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Test Value", 11, 0);
- test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
- "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
- "\t@\t=\tdword:\t00000008\t\n\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_DWORD, &dword, sizeof(DWORD), 0);
- close_key(hkey);
- delete_key(HKEY_CURRENT_USER, KEY_BASE);
- }
- static void test_import_win31(void)
- {
- LONG err;
- HKEY hkey;
- DWORD r;
- /* Check if reg.exe is running with elevated privileges */
- err = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE);
- if (err == ERROR_ACCESS_DENIED)
- {
- win_skip("reg.exe is not running with elevated privileges; "
- "skipping Windows 3.1 import tests\n");
- return;
- }
- if (err == ERROR_FILE_NOT_FOUND)
- {
- if (RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE,
- KEY_READ, NULL, &hkey, NULL))
- {
- win_skip("reg.exe is not running with elevated privileges; "
- "skipping Windows 3.1 import tests\n");
- return;
- }
- RegCloseKey(hkey);
- RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE);
- }
- /* Test simple value */
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value0\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- open_key(HKEY_CLASSES_ROOT, KEY_BASE, KEY_SET_VALUE, &hkey);
- verify_reg(hkey, "", REG_SZ, "Value0", 7, 0);
- /* Test proper handling of spaces and equals signs */
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " =Value1\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Value1", 7, 0);
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, " Value2", 8, 0);
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " = Value3 \r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Value3 ", 8, 0);
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " Value4\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Value4", 7, 0);
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " Value5\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "Value5", 7, 0);
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE "\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "", 1, 0);
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " \r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "", 1, 0);
- test_import_str("REGEDIT\r\n"
- "HKEY_CLASSES_ROOT\\" KEY_BASE " = No newline", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg(hkey, "", REG_SZ, "No newline", 11, 0);
- delete_value(hkey, NULL);
- /* Test character validity at the start of the line */
- test_import_str("REGEDIT\r\n"
- " HKEY_CLASSES_ROOT\\" KEY_BASE " = Value1a\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
- test_import_str("REGEDIT\r\n"
- " HKEY_CLASSES_ROOT\\" KEY_BASE " = Value1b\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
- test_import_str("REGEDIT\r\n"
- "\tHKEY_CLASSES_ROOT\\" KEY_BASE " = Value1c\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
- test_import_str("REGEDIT\r\n"
- ";HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2a\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
- test_import_str("REGEDIT\r\n"
- "#HKEY_CLASSES_ROOT\\" KEY_BASE " = Value2b\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
- /* Test case sensitivity */
- test_import_str("REGEDIT\r\n"
- "hkey_classes_root\\" KEY_BASE " = Value3a\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
- test_import_str("REGEDIT\r\n"
- "hKEY_CLASSES_ROOT\\" KEY_BASE " = Value3b\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
- test_import_str("REGEDIT\r\n"
- "Hkey_Classes_Root\\" KEY_BASE " = Value3c\r\n", &r);
- ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
- verify_reg_nonexist(hkey, "");
- close_key(hkey);
- delete_key(HKEY_CLASSES_ROOT, KEY_BASE);
- }
- START_TEST(import)
- {
- DWORD r;
- if (!run_reg_exe("reg.exe /?", &r)) {
- win_skip("reg.exe not available, skipping 'import' tests\n");
- return;
- }
- test_import();
- test_unicode_import();
- test_import_with_whitespace();
- test_unicode_import_with_whitespace();
- test_import_win31();
- }
|